1 //-----------------------------------------------------------------------------
2 // boost detail/reference_content.hpp header file
3 // See http://www.boost.org for updates, documentation, and revision history.
4 //-----------------------------------------------------------------------------
9 // Distributed under the Boost Software License, Version 1.0. (See
10 // accompanying file LICENSE_1_0.txt or copy at
11 // http://www.boost.org/LICENSE_1_0.txt)
13 #ifndef BOOST_DETAIL_REFERENCE_CONTENT_HPP
14 #define BOOST_DETAIL_REFERENCE_CONTENT_HPP
16 #include "boost/config.hpp"
18 # include "boost/mpl/bool.hpp"
19 # include "boost/type_traits/has_nothrow_copy.hpp"
21 #include "boost/mpl/void.hpp"
27 ///////////////////////////////////////////////////////////////////////////////
28 // (detail) class template reference_content
30 // Non-Assignable wrapper for references.
32 template <typename RefT>
33 class reference_content
35 private: // representation
45 reference_content(RefT r)
50 reference_content(const reference_content& operand)
51 : content_( operand.content_ )
55 private: // non-Assignable
57 reference_content& operator=(const reference_content&);
68 ///////////////////////////////////////////////////////////////////////////////
69 // (detail) metafunction make_reference_content
71 // Wraps with reference_content if specified type is reference.
74 template <typename T = mpl::void_> struct make_reference_content;
78 struct make_reference_content
84 struct make_reference_content< T& >
86 typedef reference_content<T&> type;
91 struct make_reference_content< mpl::void_ >
95 : make_reference_content<T>
99 typedef mpl::void_ type;
102 } // namespace detail
104 ///////////////////////////////////////////////////////////////////////////////
105 // reference_content<T&> type traits specializations
109 template <typename T>
110 struct has_nothrow_copy<
111 ::boost::detail::reference_content< T& >
120 #endif // BOOST_DETAIL_REFERENCE_CONTENT_HPP