Skip to content

Search topics & cppreference

Search all study topics, concept maps, and 6,587 C++ and C reference pages.

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

A UnaryTypeTrait is a class template that describes a property of its template type parameter with an std::integral_constant (typically std::bool_constant) specialization.

NotebookLM

A UnaryTypeTrait is a class template that describes a property of its template type parameter with an std::integral_constant (typically std::bool_constant) specialization.

Requirements

  • DefaultConstructible and CopyConstructible.
  • Takes one template type parameter (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.

Standard library

The following type traits all satisfy UnaryTypeTrait:

The following standard library class templates also satisfy UnaryTypeTrait.

compile-time constant of specified type with specified value
(class template)
(C++17)
logical NOT metafunction
(class template)
obtains the size of

a tuple
(class template specialization)

obtains the size of an array
(class template specialization)
obtains the size of a pair
(class template specialization)
obtains the size of the variant's list of alternatives at compile time
(class template) (variable template)
indicates that an object is std::bind expression or can be used as one
(class template)
indicates that an object is a standard placeholder or can be used as one
(class template)
test whether a class represents an execution policy
(class template)

Content from this page on cppreference.com, licensed under CC-BY-SA 3.0 and GFDL. Modified: restyled, site navigation removed, code windows added. Offline snapshot of 9 February 2025.