File indexing completed on 2025-01-18 09:30:42
0001
0002
0003
0004
0005
0006
0007
0008
0009
0010
0011
0012
0013 #ifndef BOOST_DETAIL_REFERENCE_CONTENT_HPP
0014 #define BOOST_DETAIL_REFERENCE_CONTENT_HPP
0015
0016 #include "boost/config.hpp"
0017
0018 # include "boost/type_traits/integral_constant.hpp"
0019 # include "boost/type_traits/has_nothrow_copy.hpp"
0020
0021 namespace boost {
0022
0023 namespace detail {
0024
0025 struct void_type {};
0026
0027
0028
0029
0030
0031
0032 template <typename RefT>
0033 class reference_content
0034 {
0035 private:
0036
0037 RefT content_;
0038
0039 public:
0040
0041 ~reference_content()
0042 {
0043 }
0044
0045 reference_content(RefT r)
0046 : content_( r )
0047 {
0048 }
0049
0050 reference_content(const reference_content& operand)
0051 : content_( operand.content_ )
0052 {
0053 }
0054
0055 private:
0056
0057 reference_content& operator=(const reference_content&);
0058
0059 public:
0060
0061 RefT get() const
0062 {
0063 return content_;
0064 }
0065
0066 };
0067
0068
0069
0070
0071
0072
0073
0074 template <typename T = void_type> struct make_reference_content;
0075
0076
0077 template <typename T>
0078 struct make_reference_content
0079 {
0080 typedef T type;
0081 };
0082
0083 template <typename T>
0084 struct make_reference_content< T& >
0085 {
0086 typedef reference_content<T&> type;
0087 };
0088
0089
0090 template <>
0091 struct make_reference_content< void_type >
0092 {
0093 template <typename T>
0094 struct apply
0095 : make_reference_content<T>
0096 {
0097 };
0098
0099 typedef void_type type;
0100 };
0101
0102 }
0103
0104
0105
0106
0107
0108
0109 template <typename T>
0110 struct has_nothrow_copy<
0111 ::boost::detail::reference_content< T& >
0112 >
0113 : boost::true_type
0114 {
0115 };
0116
0117
0118 }
0119
0120 #endif