GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • cpprefjp - C++日本語リファレンス
  • GitHub Project

This view

  • Original page
  • New address

GeezerVison is showing cpprefjp.github.io — std::meta::is_nothrow_convertible_type - cpprefjp C++日本語リファレンス

  1. リファレンス
  2. meta
  3. is_nothrow_convertible_type

最終更新日時: 2026年05月07日 12時33分06秒 (JST)
Akira Takahashi が更新

履歴 編集

function
<meta>

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

namespace std::meta {
  consteval bool is_nothrow_convertible_type(info type_src, info type_dst);
}

概要

型が別の型に例外を送出せずに変換可能かを判定する。std::is_nothrow_convertibleに対応する。

戻り値

type_srcがtype_dstに例外を送出せずに変換可能な場合にtrueを返す。

例外

type_srcまたはtype_dstが型を表さない場合、std::meta::exception例外を送出する。

例

#include <meta>

struct A {};
struct B {
  B(const A&) noexcept {}
};
struct C {
  C(const A&) noexcept(false) {}
};

int main() {
  static_assert(std::meta::is_nothrow_convertible_type(^^int, ^^double));
  static_assert(std::meta::is_nothrow_convertible_type(^^A, ^^B));
  static_assert(!std::meta::is_nothrow_convertible_type(^^A, ^^C));
}

出力

バージョン

言語

  • C++26

処理系

  • Clang: ??
  • GCC: 16 (-freflection オプション指定) ✅
  • Visual C++: ??

関連項目

  • std::is_nothrow_convertible

参照

  • P2996R13 Reflection for C++26
You are visitor 01402520 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.