Skip to content

Commit 14efe7c

Browse files
committed
Added indirect_reference_t alias.
1 parent c54bb4a commit 14efe7c

File tree

1 file changed

+12
-9
lines changed

1 file changed

+12
-9
lines changed
Lines changed: 12 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
1-
#ifndef INDIRECT_REFERENCE_DWA200415_HPP
2-
#define INDIRECT_REFERENCE_DWA200415_HPP
1+
#ifndef BOOST_INDIRECT_REFERENCE_DWA200415_HPP
2+
#define BOOST_INDIRECT_REFERENCE_DWA200415_HPP
33

44
//
55
// Copyright David Abrahams 2004. Use, modification and distribution is
@@ -11,33 +11,36 @@
1111
// http://www.boost.org/libs/iterator/doc/pointee.html
1212
//
1313

14+
#include <type_traits>
15+
1416
#include <boost/detail/is_incrementable.hpp>
1517
#include <boost/iterator/iterator_traits.hpp>
1618
#include <boost/pointee.hpp>
1719

18-
#include <type_traits>
19-
2020
namespace boost {
2121
namespace detail {
2222

2323
template< typename P >
2424
struct smart_ptr_reference
2525
{
26-
using type = typename boost::pointee<P>::type&;
26+
using type = boost::pointee_t< P >&;
2727
};
2828

2929
} // namespace detail
3030

3131
template< typename P >
3232
struct indirect_reference :
3333
std::conditional<
34-
detail::is_incrementable<P>::value,
35-
iterator_reference<P>,
36-
detail::smart_ptr_reference<P>
34+
detail::is_incrementable< P >::value,
35+
iterator_reference< P >,
36+
detail::smart_ptr_reference< P >
3737
>::type
3838
{
3939
};
4040

41+
template< typename P >
42+
using indirect_reference_t = typename indirect_reference< P >::type;
43+
4144
} // namespace boost
4245

43-
#endif // INDIRECT_REFERENCE_DWA200415_HPP
46+
#endif // BOOST_INDIRECT_REFERENCE_DWA200415_HPP

0 commit comments

Comments
 (0)