Jeff Thompson | 2491bd6 | 2013-10-15 17:10:24 -0700 | [diff] [blame] | 1 | #ifndef INDIRECT_REFERENCE_NDNBOOST_DWA200415_HPP |
| 2 | # define INDIRECT_REFERENCE_NDNBOOST_DWA200415_HPP |
Jeff Thompson | ef2d5a4 | 2013-08-22 19:09:24 -0700 | [diff] [blame] | 3 | |
| 4 | // |
| 5 | // Copyright David Abrahams 2004. Use, modification and distribution is |
| 6 | // subject to the Boost Software License, Version 1.0. (See accompanying |
| 7 | // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) |
| 8 | // |
| 9 | // typename indirect_reference<P>::type provides the type of *p. |
| 10 | // |
| 11 | // http://www.boost.org/libs/iterator/doc/pointee.html |
| 12 | // |
| 13 | |
| 14 | # include <ndnboost/detail/is_incrementable.hpp> |
| 15 | # include <ndnboost/iterator/iterator_traits.hpp> |
| 16 | # include <ndnboost/type_traits/remove_cv.hpp> |
| 17 | # include <ndnboost/mpl/eval_if.hpp> |
| 18 | # include <ndnboost/pointee.hpp> |
| 19 | |
| 20 | namespace ndnboost { |
| 21 | |
| 22 | namespace detail |
| 23 | { |
| 24 | template <class P> |
| 25 | struct smart_ptr_reference |
| 26 | { |
| 27 | typedef typename ndnboost::pointee<P>::type& type; |
| 28 | }; |
| 29 | } |
| 30 | |
| 31 | template <class P> |
| 32 | struct indirect_reference |
| 33 | : mpl::eval_if< |
| 34 | detail::is_incrementable<P> |
| 35 | , iterator_reference<P> |
| 36 | , detail::smart_ptr_reference<P> |
| 37 | > |
| 38 | { |
| 39 | }; |
| 40 | |
| 41 | } // namespace ndnboost |
| 42 | |
Jeff Thompson | 2491bd6 | 2013-10-15 17:10:24 -0700 | [diff] [blame] | 43 | #endif // INDIRECT_REFERENCE_NDNBOOST_DWA200415_HPP |