1- #ifndef POINTEE_DWA200415_HPP
2- #define POINTEE_DWA200415_HPP
1+ #ifndef BOOST_POINTEE_DWA200415_HPP
2+ #define BOOST_POINTEE_DWA200415_HPP
33
44//
55// Copyright David Abrahams 2004. Use, modification and distribution is
1313// http://www.boost.org/libs/iterator/doc/pointee.html
1414//
1515
16- #include < boost/detail/is_incrementable.hpp>
17- #include < boost/iterator/iterator_traits.hpp>
18-
1916#include < iterator>
2017#include < type_traits>
2118
19+ #include < boost/detail/is_incrementable.hpp>
20+
2221namespace boost {
2322namespace detail {
2423
@@ -28,30 +27,36 @@ struct smart_ptr_pointee
2827 using type = typename P::element_type;
2928};
3029
31- template < typename Iterator, typename = typename std::remove_reference<decltype (*std::declval<Iterator&>())>::type >
30+ template <
31+ typename Iterator,
32+ typename = typename std::remove_reference< decltype (*std::declval< Iterator& >()) >::type
33+ >
3234struct iterator_pointee
3335{
34- using type = typename std::iterator_traits<Iterator>::value_type;
36+ using type = typename std::iterator_traits< Iterator >::value_type;
3537};
3638
3739template < typename Iterator, typename Reference >
3840struct iterator_pointee < Iterator, const Reference >
3941{
40- using type = typename std::add_const<typename std::iterator_traits<Iterator>::value_type>::type;
42+ using type = typename std::add_const< typename std::iterator_traits< Iterator >::value_type >::type;
4143};
4244
4345} // namespace detail
4446
4547template < typename P >
4648struct pointee :
4749 public std::conditional<
48- detail::is_incrementable<P >::value,
49- detail::iterator_pointee<P >,
50- detail::smart_ptr_pointee<P >
50+ detail::is_incrementable< P >::value,
51+ detail::iterator_pointee< P >,
52+ detail::smart_ptr_pointee< P >
5153 >::type
5254{
5355};
5456
57+ template < typename P >
58+ using pointee_t = typename pointee< P >::type;
59+
5560} // namespace boost
5661
57- #endif // POINTEE_DWA200415_HPP
62+ #endif // BOOST_POINTEE_DWA200415_HPP
0 commit comments