Skip to content

Latest commit

 

History

History
63 lines (48 loc) · 1.64 KB

File metadata and controls

63 lines (48 loc) · 1.64 KB

コンストラクタ

  • cpp17[meta cpp]
  • node_handle[meta category]
  • node_handle[meta class]
  • function[meta id-type]
  • [meta namespace]
node_handle() noexcept : ptr_(), alloc_() {}           // (1) C++17
constexpr node_handle() noexcept : ptr_(), alloc_() {} // (1) C++26

node_handle(node_handle&& nh) noexcept;           // (2) C++17
constexpr node_handle(node_handle&& nh) noexcept; // (2) C++26

概要

  • (1) : デフォルトコンストラクタ
  • (2) : ムーブコンストラクタ

効果

(2) : ノードハンドルオブジェクトを nh.ptr_ptr_ を初期化して構築する。alloc_nh.alloc_でムーブコンストラクトする。 nh.ptr_nullptr を割り当て、nh.alloc_nullopt を割り当てる。

戻り値

なし

#include <iostream>
#include <set>

int main()
{
  std::set<int>::node_type nh;                  // (1)
  // std::set<int>::node_type nh2 = nh;         // コピー構築はできない
  std::set<int>::node_type nh2 = std::move(nh); // (2)
  std::cout << static_cast<bool>(nh2);
}
  • node_type[color ff0000]

出力

0

バージョン

言語

  • C++17

処理系

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

参照