tetl 0.1.0
Embedded Template Library
Loading...
Searching...
No Matches
in_place_type.hpp
Go to the documentation of this file.
1// SPDX-License-Identifier: BSL-1.0
2// SPDX-FileCopyrightText: Copyright (C) 2021 Tobias Hienzsch
3
4#ifndef TETL_UTILITY_IN_PLACE_TYPE_HPP
5#define TETL_UTILITY_IN_PLACE_TYPE_HPP
6
7#include <etl/_cstddef/size_t.hpp>
8
9namespace etl {
10
11/// \brief Disambiguation tags that can be passed to the constructors of
12/// etl::optional, etl::variant, and etl::any to indicate that the contained
13/// object should be constructed in-place, and (for the latter two) the type of
14/// the object to be constructed.
15///
16/// \details The corresponding type/type templates etl::in_place_t,
17/// etl::in_place_type_t and etl::in_place_index_t can be used in the
18/// constructor's parameter list to match the intended tag.
19template <typename T>
21 explicit in_place_type_t() = default;
22};
23
24/// \relates in_place_type_t
25template <typename T>
26inline constexpr auto in_place_type = in_place_type_t<T>{};
27
28} // namespace etl
29
30#endif // TETL_UTILITY_IN_PLACE_TYPE_HPP
Definition adjacent_find.hpp:9
Disambiguation tags that can be passed to the constructors of etl::optional, etl::variant,...
Definition in_place_type.hpp:20
in_place_type_t()=default
constexpr auto in_place_type
Definition in_place_type.hpp:26