12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152 |
- #ifndef BOOST_SCOPE_DETAIL_MOVE_OR_COPY_ASSIGN_REF_HPP_INCLUDED_
- #define BOOST_SCOPE_DETAIL_MOVE_OR_COPY_ASSIGN_REF_HPP_INCLUDED_
- #include <type_traits>
- #include <boost/scope/detail/config.hpp>
- #include <boost/scope/detail/header.hpp>
- #ifdef BOOST_HAS_PRAGMA_ONCE
- #pragma once
- #endif
- namespace boost {
- namespace scope {
- namespace detail {
- template< typename From, typename To = From >
- struct move_or_copy_assign_ref
- {
- using type = typename std::conditional<
- std::is_nothrow_assignable< To, From >::value,
- From&&,
- From const&
- >::type;
- };
- template< typename From, typename To >
- struct move_or_copy_assign_ref< From&, To >
- {
- using type = From&;
- };
- }
- }
- }
- #include <boost/scope/detail/footer.hpp>
- #endif
|