最終更新日時:
が更新

履歴 編集

function
<memory>

std::pointer_tag_pair::tag(C++29)

constexpr tag_type tag() const noexcept; // (1) C++29

概要

保持しているタグ値を取得する。

戻り値

*thisが表すタグ値。

例外

投げない。

#include <memory>
#include <iostream>

int main()
{
  int x = 42;
  std::pointer_tag_pair<int*, 2> p{&x, 3u};

  std::cout << p.tag() << std::endl;
}

出力

3

バージョン

言語

  • C++29

処理系

参照