1 /* boost random/detail/ptr_helper.hpp header file
3 * Copyright Jens Maurer 2002
4 * Distributed under the Boost Software License, Version 1.0. (See
5 * accompanying file LICENSE_1_0.txt or copy at
6 * http://www.boost.org/LICENSE_1_0.txt)
8 * See http://www.boost.org for most recent version including documentation.
14 #ifndef BOOST_RANDOM_DETAIL_PTR_HELPER_HPP
15 #define BOOST_RANDOM_DETAIL_PTR_HELPER_HPP
17 #include <boost/config.hpp>
24 // type_traits could help here, but I don't want to depend on type_traits.
29 typedef T& reference_type;
30 typedef const T& rvalue_type;
31 static reference_type ref(T& r) { return r; }
32 static const T& ref(const T& r) { return r; }
39 typedef T& reference_type;
40 typedef T& rvalue_type;
41 static reference_type ref(T& r) { return r; }
42 static const T& ref(const T& r) { return r; }
49 typedef T& reference_type;
50 typedef T* rvalue_type;
51 static reference_type ref(T * p) { return *p; }
52 static const T& ref(const T * p) { return *p; }
60 // BOOST_RANDOM_PTR_HELPER_SPEC --
62 // Helper macro for broken compilers defines specializations of
65 # define BOOST_RANDOM_PTR_HELPER_SPEC(T)
67 #endif // BOOST_RANDOM_DETAIL_PTR_HELPER_HPP