1 // Copyright David Abrahams 2004. Use, modification and distribution is
2 // subject to the Boost Software License, Version 1.0. (See accompanying
3 // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
4 #ifndef POINTEE_DWA200415_HPP
5 # define POINTEE_DWA200415_HPP
7 // dereferenceable_traits provides access to the value_type and
8 // reference of a Dereferenceable type.
10 # include <boost/detail/is_incrementable.hpp>
11 # include <boost/iterator/iterator_traits.hpp>
12 # include <boost/type_traits/add_const.hpp>
13 # include <boost/type_traits/remove_cv.hpp>
14 # include <boost/mpl/if.hpp>
15 # include <boost/mpl/eval_if.hpp>
22 struct smart_ptr_pointee
24 typedef typename P::element_type type;
27 template <class Iterator>
28 struct iterator_pointee
30 typedef typename iterator_traits<Iterator>::value_type value_type;
35 static char test(T const&);
37 static char (& test(value_type&) )[2];
42 BOOST_STATIC_CONSTANT(bool, is_constant = sizeof(impl::test(*impl::x)) == 1);
44 typedef typename mpl::if_c<
45 # if BOOST_WORKAROUND(__BORLANDC__, BOOST_TESTED_AT(0x551))
46 ::boost::detail::iterator_pointee<Iterator>::is_constant
50 , typename add_const<value_type>::type
59 detail::is_incrementable<P>
60 , detail::iterator_pointee<P>
61 , detail::smart_ptr_pointee<P>
68 #endif // POINTEE_DWA200415_HPP