Back to home page

EIC code displayed by LXR

 
 

    


File indexing completed on 2026-05-03 08:14:06

0001 //===----------------------------------------------------------------------===//
0002 //
0003 // Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
0004 // See https://llvm.org/LICENSE.txt for license information.
0005 // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
0006 //
0007 //===----------------------------------------------------------------------===//
0008 
0009 #ifndef _LIBCPP___UTILITY_IN_PLACE_H
0010 #define _LIBCPP___UTILITY_IN_PLACE_H
0011 
0012 #include <__config>
0013 #include <__cstddef/size_t.h>
0014 #include <__type_traits/integral_constant.h>
0015 #include <__type_traits/remove_cvref.h>
0016 
0017 #if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
0018 #  pragma GCC system_header
0019 #endif
0020 
0021 _LIBCPP_BEGIN_NAMESPACE_STD
0022 
0023 #if _LIBCPP_STD_VER >= 17
0024 
0025 struct _LIBCPP_EXPORTED_FROM_ABI in_place_t {
0026   explicit in_place_t() = default;
0027 };
0028 inline constexpr in_place_t in_place{};
0029 
0030 template <class _Tp>
0031 struct _LIBCPP_TEMPLATE_VIS in_place_type_t {
0032   _LIBCPP_HIDE_FROM_ABI explicit in_place_type_t() = default;
0033 };
0034 template <class _Tp>
0035 inline constexpr in_place_type_t<_Tp> in_place_type{};
0036 
0037 template <size_t _Idx>
0038 struct _LIBCPP_TEMPLATE_VIS in_place_index_t {
0039   _LIBCPP_HIDE_FROM_ABI explicit in_place_index_t() = default;
0040 };
0041 template <size_t _Idx>
0042 inline constexpr in_place_index_t<_Idx> in_place_index{};
0043 
0044 template <class _Tp>
0045 struct __is_inplace_type_imp : false_type {};
0046 template <class _Tp>
0047 struct __is_inplace_type_imp<in_place_type_t<_Tp>> : true_type {};
0048 
0049 template <class _Tp>
0050 using __is_inplace_type _LIBCPP_NODEBUG = __is_inplace_type_imp<__remove_cvref_t<_Tp>>;
0051 
0052 template <class _Tp>
0053 struct __is_inplace_index_imp : false_type {};
0054 template <size_t _Idx>
0055 struct __is_inplace_index_imp<in_place_index_t<_Idx>> : true_type {};
0056 
0057 template <class _Tp>
0058 using __is_inplace_index _LIBCPP_NODEBUG = __is_inplace_index_imp<__remove_cvref_t<_Tp>>;
0059 
0060 #endif // _LIBCPP_STD_VER >= 17
0061 
0062 _LIBCPP_END_NAMESPACE_STD
0063 
0064 #endif // _LIBCPP___UTILITY_IN_PLACE_H