File indexing completed on 2025-01-18 09:51:09
0001
0002
0003
0004
0005
0006
0007
0008
0009
0010
0011
0012
0013
0014 #ifndef BOOST_RANDOM_DETAIL_PTR_HELPER_HPP
0015 #define BOOST_RANDOM_DETAIL_PTR_HELPER_HPP
0016
0017 #include <boost/config.hpp>
0018
0019
0020 namespace boost {
0021 namespace random {
0022 namespace detail {
0023
0024
0025 template<class T>
0026 struct ptr_helper
0027 {
0028 typedef T value_type;
0029 typedef T& reference_type;
0030 typedef const T& rvalue_type;
0031 static reference_type ref(T& r) { return r; }
0032 static const T& ref(const T& r) { return r; }
0033 };
0034
0035 template<class T>
0036 struct ptr_helper<T&>
0037 {
0038 typedef T value_type;
0039 typedef T& reference_type;
0040 typedef T& rvalue_type;
0041 static reference_type ref(T& r) { return r; }
0042 static const T& ref(const T& r) { return r; }
0043 };
0044
0045 template<class T>
0046 struct ptr_helper<T*>
0047 {
0048 typedef T value_type;
0049 typedef T& reference_type;
0050 typedef T* rvalue_type;
0051 static reference_type ref(T * p) { return *p; }
0052 static const T& ref(const T * p) { return *p; }
0053 };
0054
0055 }
0056 }
0057 }
0058
0059
0060
0061
0062
0063
0064
0065 # define BOOST_RANDOM_PTR_HELPER_SPEC(T)
0066
0067 #endif