Back to home page

EIC code displayed by LXR

 
 

    


File indexing completed on 2025-09-17 08:40:05

0001 // Copyright (C) 2024 Ryan Malcolm Underwood.
0002 //
0003 // Use, modification, and distribution is subject to the Boost Software
0004 // License, Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at
0005 // http://www.boost.org/LICENSE_1_0.txt)
0006 //
0007 // See http://www.boost.org/libs/optional for documentation.
0008 //
0009 // You are welcome to contact the author at:
0010 //  typenametea@gmail.com
0011 
0012 #ifndef BOOST_OPTIONAL_OPTIONAL_DETAIL_OPTIONAL_UTILITY_RMU_06OCT2024_HPP
0013 #define BOOST_OPTIONAL_OPTIONAL_DETAIL_OPTIONAL_UTILITY_RMU_06OCT2024_HPP
0014 
0015 namespace boost {
0016 namespace optional_detail {
0017 
0018 // Workaround: forward and move aren't constexpr in C++11
0019 template <class T>
0020 inline constexpr T&& forward(typename boost::remove_reference<T>::type& t) noexcept
0021 {
0022   return static_cast<T&&>(t);
0023 }
0024 
0025 template <class T>
0026 inline constexpr T&& forward(typename boost::remove_reference<T>::type&& t) noexcept
0027 {
0028   static_assert(!boost::is_lvalue_reference<T>::value, "Can not forward an rvalue as an lvalue.");
0029   return static_cast<T&&>(t);
0030 }
0031 
0032 template <class T>
0033 inline constexpr typename boost::remove_reference<T>::type&& move(T&& t) noexcept
0034 {
0035   return static_cast<typename boost::remove_reference<T>::type&&>(t);
0036 }
0037 
0038 } // namespace optional_detail
0039 } // namespace boost
0040 
0041 #endif