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

履歴 編集

function
<meta>

std::meta::is_nothrow_move_constructible_type(C++26)

namespace std::meta {
  consteval bool is_nothrow_move_constructible_type(info type);
}

概要

例外を送出せずにムーブ構築可能型であるかを判定する。std::is_nothrow_move_constructibleに対応する。

戻り値

typeが表す型が例外を送出せずにムーブ構築可能型である場合にtrueを返す。

例外

typeが型を表さない場合、std::meta::exception例外を送出する。

#include <meta>
#include <string>
#include <vector>

struct Throwing {
  Throwing(Throwing&&) noexcept(false) {}
};

int main() {
  static_assert(std::meta::is_nothrow_move_constructible_type(^^int));
  static_assert(std::meta::is_nothrow_move_constructible_type(^^std::string));
  static_assert(std::meta::is_nothrow_move_constructible_type(^^std::vector<int>));
  static_assert(!std::meta::is_nothrow_move_constructible_type(^^Throwing));
}

出力

バージョン

言語

  • C++26

処理系

関連項目

参照