Skip to content

Latest commit

 

History

History
36 lines (28 loc) · 1.49 KB

in-place-t-struct-in-place-type-t-struct-in-place-index-t-struct.md

File metadata and controls

36 lines (28 loc) · 1.49 KB
description title ms.date f1_keywords helpviewer_keywords
Learn more about: in_place_t Struct, in_place_type_t Struct, in_place_index_t Struct
in_place_t Struct, in_place_type_t Struct, in_place_index_t Struct
11/04/2016
utility<in_place_t>
utility/std::in_place_t
utility<in_place_type_t>
utility/std::in_place_type_t
utility<in_place_index_t>
utility/std::in_place_index_t
utility<in_place_t> struct

in_place_t Struct, in_place_type_t Struct, in_place_index_t Struct

The empty structure type in_place_t can be passed into constructors of expected class, optional class or single_view class for in-place construction of the contained type. The empty structure type in_place_type_t can be passed into constructors of any class or variant class to specify the type of the object. The empty structure type in_place_index_t can be passed into constructors of variant class to specify the index of the object.

Syntax

struct in_place_t {
    explicit in_place_t() = default;
};

inline constexpr in_place_t in_place{};

template <class T>
struct in_place_type_t {
    explicit in_place_type_t() = default;
};

template <class T>
inline constexpr in_place_type_t<T> in_place_type{};

template <size_t I>
struct in_place_index_t {
    explicit in_place_index_t() = default;
};

template <size_t I>
inline constexpr in_place_index_t<I> in_place_index{};