// Copyright (C) 2024 Andrzej Krzemienski. // // Use, modification, and distribution is subject to the Boost Software // License, Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at // http://www.boost.org/LICENSE_1_0.txt) // // See http://www.boost.org/libs/optional for documentation. // // You are welcome to contact the author at: // akrzemi1@gmail.com #ifndef BOOST_OPTIONAL_OPTIONAL_DETAIL_OPTIONAL_UTILITY_HPP #define BOOST_OPTIONAL_OPTIONAL_DETAIL_OPTIONAL_UTILITY_HPP namespace boost { namespace optional_detail { // Workaround: forward and move aren't constexpr in C++11 template inline constexpr T&& forward(typename boost::remove_reference::type& t) noexcept { return static_cast(t); } template inline constexpr T&& forward(typename boost::remove_reference::type&& t) noexcept { BOOST_STATIC_ASSERT_MSG(!boost::is_lvalue_reference::value, "Can not forward an rvalue as an lvalue."); return static_cast(t); } template inline constexpr typename boost::remove_reference::type&& move(T&& t) noexcept { return static_cast::type&&>(t); } } // namespace optional_detail } // namespace boost #endif