Namespaces
Variants
Actions

C++ named requirements: BinaryTypeTrait (since C++11)

From cppreference.com
< cpp‎ | named req
 
C++
 
C++ named requirements
 

A BinaryTypeTrait is a class template that describes a relationship between its two template type parameters with a std::integral_constant (typically std::bool_constant) specialization.

[edit] Requirements

  • DefaultConstructible and CopyConstructible.
  • Takes two template type parameters (additional template parameters are optional and allowed).
  • Publicly and unambiguously derived from a specialization of std::integral_constant, known as its base characteristic.
  • The member names of the base characteristic are not hidden and are unambiguously available.

[edit] Standard library

The following standard library class templates satisfy BinaryTypeTrait:

(C++11)
checks if two types are the same
(class template) [edit]
checks if a type is a base of the other type
(class template) [edit]
checks if a type is a virtual base of the other type
(class template) [edit]
checks if a type can be converted to the other type
(class template) [edit]
checks if two types are layout-compatible
(class template) [edit]
checks if a type is a pointer-interconvertible (initial) base of another type
(class template) [edit]
checks if a type can be invoked (as if by std::invoke) with the given argument types
(class template) [edit]
checks if the specified type supports uses-allocator construction
(class template) [edit]

Follow Lee on X/Twitter - Father, Husband, Serial builder creating AI, crypto, games & web tools. We are friends :) AI Will Come To Life!

Check out: eBank.nz (Art Generator) | Netwrck.com (AI Tools) | Text-Generator.io (AI API) | BitBank.nz (Crypto AI) | ReadingTime (Kids Reading) | RewordGame | BigMultiplayerChess | WebFiddle | How.nz | Helix AI Assistant