* This function is used to implement "perfect forwarding".
*/
template<typename _Tp>
+ _GLIBCXX_NODISCARD
constexpr _Tp&&
forward(typename std::remove_reference<_Tp>::type& __t) noexcept
{ return static_cast<_Tp&&>(__t); }
* This function is used to implement "perfect forwarding".
*/
template<typename _Tp>
+ _GLIBCXX_NODISCARD
constexpr _Tp&&
forward(typename std::remove_reference<_Tp>::type&& __t) noexcept
{
* @return The parameter cast to an rvalue-reference to allow moving it.
*/
template<typename _Tp>
+ _GLIBCXX_NODISCARD
constexpr typename std::remove_reference<_Tp>::type&&
move(_Tp&& __t) noexcept
{ return static_cast<typename std::remove_reference<_Tp>::type&&>(__t); }
* type is copyable, in which case an lvalue-reference is returned instead.
*/
template<typename _Tp>
+ _GLIBCXX_NODISCARD
constexpr typename
conditional<__move_if_noexcept_cond<_Tp>::value, const _Tp&, _Tp&&>::type
move_if_noexcept(_Tp& __x) noexcept
* @return The actual address.
*/
template<typename _Tp>
+ _GLIBCXX_NODISCARD
inline _GLIBCXX17_CONSTEXPR _Tp*
addressof(_Tp& __r) noexcept
{ return std::__addressof(__r); }
{ return __l = __l ^ __r; }
template<typename _IntegerType>
+ [[nodiscard]]
constexpr _IntegerType
to_integer(__byte_op_t<_IntegerType> __b) noexcept
{ return _IntegerType(__b); }
/// Create a value of type `To` from the bits of `from`.
template<typename _To, typename _From>
+ [[nodiscard]]
constexpr _To
bit_cast(const _From& __from) noexcept
{
#define __cpp_lib_as_const 201510
template<typename _Tp>
- constexpr add_const_t<_Tp>& as_const(_Tp& __t) noexcept { return __t; }
+ [[nodiscard]]
+ constexpr add_const_t<_Tp>&
+ as_const(_Tp& __t) noexcept
+ { return __t; }
template<typename _Tp>
void as_const(const _Tp&&) = delete;
#define __cpp_lib_to_underlying 202102L
/// Convert an object of enumeration type to its underlying type.
template<typename _Tp>
+ [[nodiscard]]
constexpr underlying_type_t<_Tp>
to_underlying(_Tp __value) noexcept
{ return static_cast<underlying_type_t<_Tp>>(__value); }