true_type std::integral_constant<bool, true> false_type std::integral_constant<bool, false> Primary type categories is_void (C++11) checks if a type is void (class template) is_null_pointer (C++11)(DR*) checks if a type is std::nullptr_t (class template) is_integral (C++...
Type traits−ratio integer_sequence(C++14) General utilities library Function objects−hash(C++11) Swap−Type operations(C++11) Integer comparison(C++20) pair−tuple(C++11) optional(C++17) expected(C++23) variant(C++17)−any(C++17) ...
在标头 <type_traits> 定义 template< class From, class To > struct is_convertible; (1) (C++11 起) template< class From, class To > struct is_nothrow_convertible; (2) (C++20 起) 1) 如果虚构的函数定义 To test() { return std::declval<From>(); } 良构,(即 std::declval<From>(...
Type traits−ratio integer_sequence(C++14) General utilities library Function objects−hash(C++11) Swap−Type operations(C++11) Integer comparison(C++20) pair−tuple(C++11) optional(C++17) expected(C++23) variant(C++17)−any(C++17) ...
__cpp_lib_type_identity 201806L (C++20) std::type_identity 示例运行此代码 #include <iostream> #include <type_traits> template<class T> T foo(T a, T b) { return a + b; } template<class T> T bar(T a, std::type_identity_t<T> b) { return a + b; } int main() { // ...
locale_type Traits::locale_type flag_type std::regex_constants::syntax_option_type 成员函数 构造函数:构造正则表达式对象 析构函数:销毁正则表达式对象 operator=:赋值内容 assign:赋值内容 观察者 mark_count:返回正则表达式中标记的子表达式的数量 flags:返回语法标志 区域设置 getloc:获取区域信息 imbue:设置区...
taskresuming_on_new_thread(std::jthread&out){coroutine_state*state=newstate();state.copy(out);auto&promise=state.promise();autoret=promise.get_return_object();// promise 的类型 由std::coroutine_traits<task>::promise_type 决定// 事实上就是 task::promise_typeco_awaitpromise.initial_suspend(...
size_typeUnsigned integer type (usuallystd::size_t) difference_typeSigned integer type (usuallystd::ptrdiff_t) referencevalue_type& const_referenceconstvalue_type& pointer Allocator::pointer (until C++11) std::allocator_traits<Allocator>::pointer ...
Type traits(C++11) ratio(C++11) integer_sequencePredefinição:mark c++14 Biblioteca de diagnósticos basic_stacktracePredefinição:mark c++23 Biblioteca de gerenciamento de memória unique_ptr(C++11) shared_ptr(C++11) Biblioteca de utilitários gerais ...
int_type Traits::int_type pos_type Traits::pos_type off_type Traits::off_type Fonctions de l'État Original: State functions The text has been machine-translated via Google Translate. You can help to correct and verify the translation. Click here for instructions. good vérifie si ...