Namespaces
Variants
Views
Actions

Difference between revisions of "Template:cpp/types/traits/is"

From cppreference.com
m (add a conditional line-break: if the length of id > 20, wrap the expr, e.g. has_unique_object_representations VS is_class.)
m (Helper variable template: bump wrapping cutoff value to 25.)
Line 21: Line 21:
 
{{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|}}}}}|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 >
inline constexpr bool {{{1|}}}_v {{#ifeq:{{#expr:{{#len:{{{1|}}}}}>20}}|0|= {{{1|}}}|=
+
inline 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|}}}}}

Revision as of 05:28, 25 April 2023

 
 
Metaprogramming library
Type traits
Type categories
(C++11)
(C++14)  
(C++11)
(C++11)
(C++11)
(C++11)
(C++11)
(C++11)
(C++11)
Type properties
(C++11)
(C++11)
(C++14)
(C++11)
(C++11)(until C++20*)
(C++11)(deprecated in C++20)
(C++11)
Type trait constants
Metafunctions
(C++17)
Supported operations
Relationships and property queries
Type modifications
(C++11)(C++11)(C++11)
Type transformations
(C++11)(deprecated in C++23)
(C++11)(deprecated in C++23)
(C++11)
(C++11)
(C++17)

(C++11)(until C++20*)(C++17)
Compile-time rational arithmetic
Compile-time integer sequences
 
<tr class="t-dcl t-since-Expression error: Missing operand for >. ">

</tr> <tr class="t-dcl-sep"><td></td><td></td><td></td></tr>

</table>


If the program adds specializations for std::is or std::is_v, the behavior is undefined.

Defined in header <type_traits>
template< class T >
struct ;

Contents

Template parameters

T - a type to check

Helper variable template

<tr class="t-dcl t-since-Expression error: Missing operand for >. ">

</tr> <tr class="t-dcl-sep"><td></td><td></td><td></td></tr>

</table>

Inherited from std::integral_constant

Member constants

template< class T >
inline constexpr bool _v =<T>::value;
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>