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

履歴 編集

機能テストマクロ(C++14)

概要

SD-6 は C++14 の機能について以下のテストマクロを定義することを推奨している:

マクロ名 機能 ヘッダ
__cpp_aggregate_nsdmi 201304 メンバ初期化子と集約 predefined
__cpp_binary_literals 201304 二進数リテラル predefined
__cpp_constexpr 201304 constexprの制限緩和/constexpr メンバ関数の暗黙的な const predefined
__cpp_decltype_auto 201304 通常関数の戻り値型推論 predefined
__cpp_generic_lambdas 201304 ジェネリックラムダ predefined
__cpp_init_captures 201304 ラムダ式の初期化キャプチャ predefined
__cpp_lib_chrono_udls 201304 std::chrono::durationユーザー定義リテラル (ns, us, ms, s, min, h) <chrono>
__cpp_lib_complex_udls 201309 ユーザー定義虚数リテラル (i, if, il) <complex>
__cpp_lib_exchange_function 201304 std::exchange <utility>
__cpp_lib_generic_associative_lookup 201304 連想配列 (std::map, std::multimap, std::set, std::multiset) における異なる型の比較 (count, equal_range, find, lower_bound, upper_bound) <map>, <set>
__cpp_lib_integer_sequence 201304 コンパイル時整数列 <utility>
__cpp_lib_integral_constant_callable 201304 std::integral_constantoperator() を追加 <type_traits>
__cpp_lib_is_final 201402 std::is_final <type_traits>
__cpp_lib_is_null_pointer 201309 std::is_null_pointer <type_traits>
__cpp_lib_make_reverse_iterator 201402 std::make_reverse_iterator <iterator>
__cpp_lib_make_unique 201304 std::make_unique <memory>
__cpp_lib_null_iterators 201304 ヌル前方向イテレータ <iterator>
__cpp_lib_quoted_string_io 201304 std::quoted <iomanip>
__cpp_lib_result_of_sfinae 201210 std::result_of と SFINAE <type_traits>
__cpp_lib_robust_nonmodifying_seq_ops 201304 シーケンスを変更しない操作をよりロバストに <algorithm>
__cpp_lib_shared_timed_mutex 201402 shared_mutexshared_timed_mutex にリネーム <shared_mutex>
__cpp_lib_string_udls 201304 ユーザー定義 std::string_literals::basic_string::sリテラル <string>
__cpp_lib_transformation_trait_aliases 201304 型トレイトにエイリアステンプレートを追加 <type_traits>
__cpp_lib_transparent_operators 201210 <functional> の二項演算のデフォルトテンプレート引数を void <functional>
__cpp_lib_tuple_element_t 201402 std::tuple_element_t <utility>
__cpp_lib_tuples_by_type 201304 型による std::tuple::get <utility>
__cpp_return_type_deduction 201304 通常関数の戻り値型推論 predefined
__cpp_sized_deallocation 201309 サイズ付きデアロケーション predefined
__cpp_variable_templates 201304 変数テンプレート predefined
__has_cpp_attribute(deprecated) 201309 [[deprecated]]属性 predefined
__has_include(<shared_mutex>) 1 共有ロック predefined

参照