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

履歴 編集

function

::node_handle::コンストラクタ(C++17)

constexpr node_handle() noexcept : ptr_(), alloc_() {} // (1)
node_handle(node_handle&& nh) noexcept;                // (2)

概要

  • (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);
}

出力

0

バージョン

言語

  • C++17

処理系

参照