最終更新日時(UTC):
が更新

履歴 編集

function

::node_handle::mapped(C++17)

mapped_type& mapped() const; // set コンテナには存在ない

概要

このノードハンドルによって管理されている map コンテナ要素の mapped_type メンバ(キーではない方)を指す参照を返す。

要件

empty() == false

戻り値

ptr_ が指す container_node_type オブジェクト内の value_type サブオブジェクトの mapped_type メンバへの参照。

例外

投げない。

#include <iostream>
#include <map>
#include <string>

int main()
{
  std::map<int, std::string> m = { 
    { 1, "nya" },
    { 2, "nyan" },
    { 3, "nyau" }
  };

  auto nh = m.extract(m.begin());
  std::cout << nh.mapped();
}

出力

nya

バージョン

言語

  • C++17

処理系

参照