diff options
Diffstat (limited to 'libstdc++-v3/include/std')
-rw-r--r-- | libstdc++-v3/include/std/type_traits | 39 | ||||
-rw-r--r-- | libstdc++-v3/include/std/version | 5 |
2 files changed, 42 insertions, 2 deletions
diff --git a/libstdc++-v3/include/std/type_traits b/libstdc++-v3/include/std/type_traits index e5f58bc..b1a1dee 100644 --- a/libstdc++-v3/include/std/type_traits +++ b/libstdc++-v3/include/std/type_traits @@ -3505,6 +3505,45 @@ template<typename _Ret, typename _Fn, typename... _Args> template<typename _Tp> inline constexpr bool is_scoped_enum_v = is_scoped_enum<_Tp>::value; +#define __cpp_lib_reference_from_temporary 202202L + + /// True if _Tp is a reference type, a _Up value can be bound to _Tp in + /// direct-initialization, and a temporary object would be bound to + /// the reference, false otherwise. + /// @since C++23 + template<typename _Tp, typename _Up> + struct reference_constructs_from_temporary + : public bool_constant<__reference_constructs_from_temporary(_Tp, _Up)> + { + static_assert(std::__is_complete_or_unbounded(__type_identity<_Tp>{}) + && std::__is_complete_or_unbounded(__type_identity<_Up>{}), + "template argument must be a complete class or an unbounded array"); + }; + + /// True if _Tp is a reference type, a _Up value can be bound to _Tp in + /// copy-initialization, and a temporary object would be bound to + /// the reference, false otherwise. + /// @since C++23 + template<typename _Tp, typename _Up> + struct reference_converts_from_temporary + : public bool_constant<__reference_converts_from_temporary(_Tp, _Up)> + { + static_assert(std::__is_complete_or_unbounded(__type_identity<_Tp>{}) + && std::__is_complete_or_unbounded(__type_identity<_Up>{}), + "template argument must be a complete class or an unbounded array"); + }; + + /// @ingroup variable_templates + /// @since C++23 + template<typename _Tp, typename _Up> + inline constexpr bool reference_constructs_from_temporary_v + = reference_constructs_from_temporary<_Tp, _Up>::value; + + /// @ingroup variable_templates + /// @since C++23 + template<typename _Tp, typename _Up> + inline constexpr bool reference_converts_from_temporary_v + = reference_converts_from_temporary<_Tp, _Up>::value; #endif // C++23 #if _GLIBCXX_HAVE_IS_CONSTANT_EVALUATED diff --git a/libstdc++-v3/include/std/version b/libstdc++-v3/include/std/version index 22280e1..5edca2f 100644 --- a/libstdc++-v3/include/std/version +++ b/libstdc++-v3/include/std/version @@ -300,10 +300,11 @@ #endif #if __cplusplus > 202002L -// c++2b +// c++23 #define __cpp_lib_byteswap 202110L #define __cpp_lib_constexpr_typeinfo 202106L #define __cpp_lib_is_scoped_enum 202011L +#define __cpp_lib_reference_from_temporary 202202L #if _GLIBCXX_HOSTED #define __cpp_lib_adaptor_iterator_pair_constructor 202106L @@ -335,7 +336,7 @@ #define __cpp_lib_to_underlying 202102L #define __cpp_lib_unreachable 202202L #endif -#endif // C++2b +#endif // C++23 #endif // C++20 #endif // C++17 #endif // C++14 |