Difference between revisions of "Template:cpp/types/traits/is"
From cppreference.com
m (→Helper variable template: bump wrapping cutoff value to 25.) |
m (→Helper variable template: -`inline`: CWG2387) |
||
(3 intermediate revisions by 3 users not shown) | |||
Line 1: | Line 1: | ||
{{cpp/title|{{{1|}}}}} | {{cpp/title|{{{1|}}}}} | ||
{{cpp/meta/navbar}} | {{cpp/meta/navbar}} | ||
− | {{ | + | {{ddcl|header=type_traits|since={{cpp/std max|c++11|{{{std|c++11}}}}}|deprecated ={{#if:{{{deprecated|}}}|{{cpp/std max|c++11|{{{deprecated|}}}}}}}|removed={{#if:{{{removed|}}}|{{cpp/std max|c++11|{{{removed|}}}}}}}|1= |
− | + | ||
− | + | ||
template< class T > | template< class T > | ||
struct {{{1|}}}; | struct {{{1|}}}; | ||
}} | }} | ||
− | |||
− | {{{description|}}} | + | {{tt|std::{{{1|}}}}} is a {{named req|UnaryTypeTrait}}. |
+ | |||
+ | {{{description|{{error|no description given}}}}} | ||
{{#ifeq:{{cpp/std max|c++14|{{{std|}}}}}|c++14|{{cpp/types/nospec|v}}|{{cpp/types/nospec|pv}}}} | {{#ifeq:{{cpp/std max|c++14|{{{std|}}}}}|c++14|{{cpp/types/nospec|v}}|{{cpp/types/nospec|pv}}}} | ||
Line 19: | Line 18: | ||
===Helper variable template=== | ===Helper variable template=== | ||
− | {{ddcl|since={{cpp/std max|c++17|{{{std|}}}}}|deprecated={{#if:{{{deprecated|}}}|{{#ifeq:{{cpp/std max|c++17|{{{deprecated|}}}}}|c++17|yes|{{{deprecated|}}}}}}}|removed={{#if:{{{removed|}}}|{{cpp/std max|c++17|{{{removed|}}}}}}}|1= | + | {{ddcl|since={{cpp/std max|c++17|{{{std|c++17}}}}}|deprecated={{#if:{{{deprecated|}}}|{{#ifeq:{{cpp/std max|c++17|{{{deprecated|}}}}}|c++17|yes|{{{deprecated|}}}}}}}|removed={{#if:{{{removed|}}}|{{cpp/std max|c++17|{{{removed|}}}}}}}|1= |
template< class T > | template< class T > | ||
− | + | constexpr bool {{{1|}}}_v {{#ifeq:{{#expr:{{#len:{{{1|}}}}}>25}}|0|= {{{1|}}}|= | |
{{{1|}}}}}<T>::value; | {{{1|}}}}}<T>::value; | ||
}} | }} | ||
{{cpp/types/integral_constant/inherit|{{{inherit_desc|}}}}} | {{cpp/types/integral_constant/inherit|{{{inherit_desc|}}}}} |
Latest revision as of 04:44, 24 September 2024
Defined in header <type_traits>
|
||
template< class T > struct ; |
(since C++11) | |
std::
is a UnaryTypeTrait.
no description given
If the program adds specializations for std::is
or std::is_v
, the behavior is undefined.
Contents |
[edit] Template parameters
T | - | a type to check |
[edit] Helper variable template
template< class T > constexpr bool _v =<T>::value; |
(since C++17) | |
Inherited from std::integral_constant
Member constants
value [static] |
true if , false otherwise (public static member constant) |
Member functions
operator bool |
converts the object to bool, returns value (public member function) |
operator() (C++14) |
returns value (public member function) |
Member types
Type | Definition |
value_type
|
bool |
type
|
std::integral_constant<bool, value> |