is_literal_type Class

Visual Studio 2015
 

The new home for Visual Studio documentation is Visual Studio 2017 Documentation on docs.microsoft.com.

The latest version of this topic can be found at is_literal_type Class.

Tests whether a type can be used as a constexpr variable or be constructed, used by, or returned from constexpr functions.

template <class T>  
struct is_literal_type;

Parameters

T
The type to query.

An instance of the type predicate holds true if the type T is a literal type, otherwise it holds false. A literal type is either void, a scalar type, a reference type, an array of literal type, or a literal class type. A literal class type is a class type that has a trivial destructor, is either an aggregate type or has at least one non-move, non-copy constexpr constructor, and all of its base classes and non-static data members are non-volatile literal types. While the type of a literal is always a literal type, the concept of a literal type includes anything that the compiler can evaluate as a constexpr at compile time.

Header: <type_traits>

Namespace: std

<type_traits>

Show: