Back to home page

EIC code displayed by LXR

 
 

    


File indexing completed on 2025-01-18 09:43:38

0001 // Copyright (c) 2016-2023 Antony Polukhin
0002 //
0003 // Distributed under the Boost Software License, Version 1.0. (See accompanying
0004 // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
0005 
0006 #ifndef BOOST_PFR_DETAIL_RVALUE_T_HPP
0007 #define BOOST_PFR_DETAIL_RVALUE_T_HPP
0008 #pragma once
0009 
0010 #include <type_traits>
0011 #include <utility>      // std::enable_if_t
0012 
0013 // This header provides aliases rvalue_t and lvalue_t.
0014 //
0015 // Usage: template <class T> void foo(rvalue<T> rvalue);
0016 //
0017 // Those are useful for
0018 //  * better type safety - you can validate at compile time that only rvalue reference is passed into the function
0019 //  * documentation and readability - rvalue_t<T> is much better than T&&+SFINAE
0020 
0021 namespace boost { namespace pfr { namespace detail {
0022 
0023 /// Binds to rvalues only, no copying allowed.
0024 template <class T
0025 #ifdef BOOST_PFR_DETAIL_STRICT_RVALUE_TESTING
0026     , class = std::enable_if_t<std::is_rvalue_reference<T&&>::value>
0027 #endif
0028 >
0029 using rvalue_t = T&&;
0030 
0031 /// Binds to mutable lvalues only
0032 
0033 }}} // namespace boost::pfr::detail
0034 
0035 #endif // BOOST_PFR_DETAIL_RVALUE_T_HPP