Skip to content

Commit c54bb4a

Browse files
committed
Added pointee_t alias.
1 parent daf024b commit c54bb4a

File tree

1 file changed

+17
-12
lines changed

1 file changed

+17
-12
lines changed

include/boost/pointee.hpp

Lines changed: 17 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
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
@@ -13,12 +13,11 @@
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+
2221
namespace boost {
2322
namespace 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+
>
3234
struct 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

3739
template< typename Iterator, typename Reference >
3840
struct 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

4547
template< typename P >
4648
struct 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

Comments
 (0)