1 //-----------------------------------------------------------------------------
\r
2 // boost detail/reference_content.hpp header file
\r
3 // See http://www.boost.org for updates, documentation, and revision history.
\r
4 //-----------------------------------------------------------------------------
\r
6 // Copyright (c) 2003
\r
9 // Distributed under the Boost Software License, Version 1.0. (See
\r
10 // accompanying file LICENSE_1_0.txt or copy at
\r
11 // http://www.boost.org/LICENSE_1_0.txt)
\r
13 #ifndef BOOST_DETAIL_REFERENCE_CONTENT_HPP
\r
14 #define BOOST_DETAIL_REFERENCE_CONTENT_HPP
\r
16 #include "boost/config.hpp"
\r
18 #if !defined(BOOST_NO_TEMPLATE_PARTIAL_SPECIALIZATION)
\r
19 # include "boost/mpl/bool.hpp"
\r
20 # include "boost/type_traits/has_nothrow_copy.hpp"
\r
22 # include "boost/mpl/if.hpp"
\r
23 # include "boost/type_traits/is_reference.hpp"
\r
26 #include "boost/mpl/void.hpp"
\r
32 ///////////////////////////////////////////////////////////////////////////////
\r
33 // (detail) class template reference_content
\r
35 // Non-Assignable wrapper for references.
\r
37 template <typename RefT>
\r
38 class reference_content
\r
40 private: // representation
\r
44 public: // structors
\r
46 ~reference_content()
\r
50 reference_content(RefT r)
\r
55 reference_content(const reference_content& operand)
\r
56 : content_( operand.content_ )
\r
60 private: // non-Assignable
\r
62 reference_content& operator=(const reference_content&);
\r
73 ///////////////////////////////////////////////////////////////////////////////
\r
74 // (detail) metafunction make_reference_content
\r
76 // Wraps with reference_content if specified type is reference.
\r
79 template <typename T = mpl::void_> struct make_reference_content;
\r
81 #if !defined(BOOST_NO_TEMPLATE_PARTIAL_SPECIALIZATION)
\r
83 template <typename T>
\r
84 struct make_reference_content
\r
89 template <typename T>
\r
90 struct make_reference_content< T& >
\r
92 typedef reference_content<T&> type;
\r
95 #else // defined(BOOST_NO_TEMPLATE_PARTIAL_SPECIALIZATION)
\r
97 template <typename T>
\r
98 struct make_reference_content
\r
101 , reference_content<T>
\r
107 #endif // BOOST_NO_TEMPLATE_PARTIAL_SPECIALIZATION workaround
\r
110 struct make_reference_content< mpl::void_ >
\r
112 template <typename T>
\r
114 : make_reference_content<T>
\r
118 typedef mpl::void_ type;
\r
121 } // namespace detail
\r
123 ///////////////////////////////////////////////////////////////////////////////
\r
124 // reference_content<T&> type traits specializations
\r
127 #if !defined(BOOST_NO_TEMPLATE_PARTIAL_SPECIALIZATION)
\r
129 template <typename T>
\r
130 struct has_nothrow_copy<
\r
131 ::boost::detail::reference_content< T& >
\r
137 #endif // !defined(BOOST_NO_TEMPLATE_PARTIAL_SPECIALIZATION)
\r
139 } // namespace boost
\r
141 #endif // BOOST_DETAIL_REFERENCE_CONTENT_HPP
\r