Skip to content

Latest commit

 

History

History
62 lines (45 loc) · 1.32 KB

File metadata and controls

62 lines (45 loc) · 1.32 KB

value

  • cpp17[meta cpp]
  • node_handle[meta category]
  • node_handle[meta class]
  • function[meta id-type]
  • [meta namespace]
value_type& value() const;           // (1) C++17 : map コンテナには存在ない
constexpr value_type& value() const; // (1) C++26 : map コンテナには存在ない

概要

このノードハンドルによって管理されている set コンテナ要素を指す参照を返す。

要件

empty() == false

戻り値

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

例外

投げない。

#include <iostream>
#include <set>

int main()
{
  std::set s = { 1, 2, 3 };
  auto nh = s.extract(s.begin());
  std::cout << nh.value();
}
  • value[color ff0000]

出力

1

バージョン

言語

  • C++17

処理系

  • Clang: 7.0.0 [mark verified]
  • GCC: 7.1.0 [mark verified]
  • ICC: ??
  • Visual C++: 2017 Update 5 [mark verified]

参照