VCCC  2024.05
VisualCamp Common C++ library
in_place.hpp
Go to the documentation of this file.
1 # /*
2 # * Created by YongGyu Lee on 2021/05/23.
3 # */
4 #
5 # ifndef VCCC_UTILITY_IN_PLACE_HPP
6 # define VCCC_UTILITY_IN_PLACE_HPP
7 #
8 # include <cstddef>
9 #if __cplusplus >= 201703L
10 # include <utility>
11 #endif
12 #
14 
15 namespace vccc {
16 
19 
20 #if __cplusplus < 201703L
21 
25 struct in_place_t {
26  constexpr explicit in_place_t() = default;
27 };
28 
29 template<typename T>
31  constexpr explicit in_place_type_t() = default;
32 };
33 
34 template<std::size_t I>
36  constexpr explicit in_place_index_t() = default;
37 };
38 
39 #else
40 
41 using in_place_t = std::in_place_t;
42 template<typename T> using in_place_type_t = std::in_place_type_t<T>;
43 template<std::size_t I> using in_place_index_t = std::in_place_index_t<I>;
44 
45 #endif
46 
48 
49 template<typename T>
51 
52 template<std::size_t I>
54 
56 
57 } // namespace vccc
58 
59 # endif // VCCC_UTILITY_IN_PLACE_HPP
constexpr VCCC_INLINE_OR_STATIC in_place_type_t< T > in_place_type
Definition: in_place.hpp:50
constexpr VCCC_INLINE_OR_STATIC in_place_t in_place
Definition: in_place.hpp:47
constexpr VCCC_INLINE_OR_STATIC in_place_index_t< I > in_place_index
Definition: in_place.hpp:53
#define VCCC_INLINE_OR_STATIC
Definition: inline_or_static.hpp:9
Definition: directory.h:12
Definition: in_place.hpp:35
constexpr in_place_index_t()=default
in-place construction tag
Definition: in_place.hpp:25
constexpr in_place_t()=default
Definition: in_place.hpp:30
constexpr in_place_type_t()=default