Namespaces
Variants
Actions

std::piecewise_construct, std::piecewise_construct_t

From cppreference.com
< cpp‎ | utility
 
 
Utilities library
General utilities
Relational operators (deprecated in C++20)
 
 
Defined in header <utility>
struct piecewise_construct_t { explicit piecewise_construct_t() = default; };
(1) (since C++11)
constexpr std::piecewise_construct_t piecewise_construct{};
(2) (since C++11)
(inline since C++17)
1) std::piecewise_construct_t is an empty class tag type used to disambiguate between different functions that take two tuple arguments.
2) The constant std::piecewise_construct is an instance of (1).

The overloads that do not use std::piecewise_construct_t assume that each tuple argument becomes the element of a pair. The overloads that use std::piecewise_construct_t assume that each tuple argument is used to construct, piecewise, a new object of specified type, which will become the element of the pair.

Contents

[edit] Standard library

The following standard library types and functions use it as a disambiguation tag: