std::type_index::name
From cppreference.com
< cpp | types | type index
| const char* name() const noexcept; |
(C++11以降) | |
関連する std::type_info オブジェクトの名前を返します。 std::type_info::name() を直接呼び出すのと同等です。
目次 |
[編集] パラメータ
(なし)
[編集] 戻り値
関連する std::type_info オブジェクトの名前。
[編集] 例
このコードを実行
#include <iostream> #include <typeindex> int main() { std::cout << std::type_index(typeid(std::cout)).name(); }
実行結果の例
NSt3__113basic_ostreamIcNS_11char_traitsIcEEEE
[編集] 不具合報告
以下の動作変更を伴う欠陥報告が、以前に公開されたC++標準に遡って適用されました。
| DR | 適用対象 | 公開された動作 | 正しい動作 |
|---|---|---|---|
| LWG 2144 | C++11 | type_index::name は noexcept である必要はありませんでした |
必要 |