File indexing completed on 2025-04-19 08:44:21
0001
0002
0003
0004
0005
0006
0007
0008
0009
0010
0011
0012
0013
0014 #ifndef BOOST_SCOPE_DETAIL_MOVE_OR_COPY_CONSTRUCT_REF_HPP_INCLUDED_
0015 #define BOOST_SCOPE_DETAIL_MOVE_OR_COPY_CONSTRUCT_REF_HPP_INCLUDED_
0016
0017 #include <type_traits>
0018 #include <boost/scope/detail/config.hpp>
0019 #include <boost/scope/detail/header.hpp>
0020
0021 #ifdef BOOST_HAS_PRAGMA_ONCE
0022 #pragma once
0023 #endif
0024
0025 namespace boost {
0026 namespace scope {
0027 namespace detail {
0028
0029
0030 template< typename From, typename To = From >
0031 struct move_or_copy_construct_ref
0032 {
0033 using type = typename std::conditional<
0034 std::is_nothrow_constructible< To, From >::value,
0035 From&&,
0036 From const&
0037 >::type;
0038 };
0039
0040 template< typename From, typename To >
0041 struct move_or_copy_construct_ref< From&, To >
0042 {
0043 using type = From&;
0044 };
0045
0046 }
0047 }
0048 }
0049
0050 #include <boost/scope/detail/footer.hpp>
0051
0052 #endif