1) 如果虚构的函数定义 To test() { return std::declval<From>(); } 良构,(即 std::declval<From>() 能用隐式转换转换为 To,或 From 和To 均为可有 cv 限定的 void),那么提供的成员常量 value 等于true。否则,value 等于false。对于此项检查而言,不认为返回语句中
Forms the logical conjunction of the type traits B..., effectively performing a logical AND on the sequence of traits. The specialization std::conjunction<B1, ..., BN> has a public and unambiguous base that is if sizeof...(B) == 0, std::true_type; otherwise the first type Bi...
true_typestd::integral_constant<bool,true> false_typestd::integral_constant<bool,false> Member types NameDefinition value_typeT typestd::integral_constant<T, v> Member constants NameValue constexprTvalue [static] v (public static member constant) ...
void print(int a, int) // second parameter is not used { std::printf("a = %d\n", a); }Even though top-level cv-qualifiers on the parameters are discarded in function declarations, they modify the type of the parameter as visible in the body of a function: ...
a cast expression to rvalue reference to function type, such as static_cast<void (&&)(int)>(x). (C++ 11 右值强转函数类型) Properties: Same as glvalue (below). Address of an lvalue may be taken: &++i[1] and &std::endl are valid expressions. ...
if ( strpos( $keywrd, "std::" ) !== false ) { $post_keywords = explode( "::", $keywrd); $keywords[] = $post_keywords[ count( $post_keywords ) - 1 ];} else if ( strpos( $keywrd, ":" ) !== false ) { $post_keywords = explode( ":", $keywrd); ...
std::tuple From cppreference.com Defined in header<tuple> template<class...Types> classtuple; (since C++11) Class templatestd::tupleis a fixed-size collection of heterogeneous values. It is a generalization ofstd::pair. Ifstd::is_trivially_destructible<Ti>::valueistruefor everyTiinTypes, ...
std::suspend_always的关键信息是constexpr bool await_ready() const noexcept { return false; } std::suspend_never自然相反constexpr bool await_ready() const noexcept { return true; } 所以对于initial_suspend返回suspend_never的即表示协程立刻启动,而suspend_always则表示后续resume调用时才会启动。
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++...
std::is_base_of<std::nested_exception, E>::value || std::is_convertible<E*, std::nested_exception*>::value) > {}; template<class T> void rethrow_if_nested_impl(const T& e, std::true_type) { if (auto nep = dynamic_cast<const std::nested_exception*>(std::addressof(e))) ...