![]() |
|
|||
File indexing completed on 2025-09-13 08:43:18
0001 // Copyright (c) 2016-2025 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 #ifdef BOOST_PFR_HAS_STD_MODULE 0011 import std; 0012 #else 0013 #include <type_traits> 0014 #include <utility> // std::enable_if_t 0015 #endif 0016 0017 // This header provides aliases rvalue_t and lvalue_t. 0018 // 0019 // Usage: template <class T> void foo(rvalue<T> rvalue); 0020 // 0021 // Those are useful for 0022 // * better type safety - you can validate at compile time that only rvalue reference is passed into the function 0023 // * documentation and readability - rvalue_t<T> is much better than T&&+SFINAE 0024 0025 namespace boost { namespace pfr { namespace detail { 0026 0027 /// Binds to rvalues only, no copying allowed. 0028 template <class T 0029 #ifdef BOOST_PFR_DETAIL_STRICT_RVALUE_TESTING 0030 , class = std::enable_if_t<std::is_rvalue_reference<T&&>::value> 0031 #endif 0032 > 0033 using rvalue_t = T&&; 0034 0035 /// Binds to mutable lvalues only 0036 0037 }}} // namespace boost::pfr::detail 0038 0039 #endif // BOOST_PFR_DETAIL_RVALUE_T_HPP
[ Source navigation ] | [ Diff markup ] | [ Identifier search ] | [ general search ] |
This page was automatically generated by the 2.3.7 LXR engine. The LXR team |
![]() ![]() |