author | William Roberts <williamr@symbian.org> |
Wed, 31 Mar 2010 12:27:01 +0100 | |
branch | Symbian2 |
changeset 3 | e1b950c65cb4 |
permissions | -rw-r--r-- |
williamr@2 | 1 |
#ifndef INDIRECT_REFERENCE_DWA200415_HPP |
williamr@2 | 2 |
# define INDIRECT_REFERENCE_DWA200415_HPP |
williamr@2 | 3 |
|
williamr@2 | 4 |
// |
williamr@2 | 5 |
// Copyright David Abrahams 2004. Use, modification and distribution is |
williamr@2 | 6 |
// subject to the Boost Software License, Version 1.0. (See accompanying |
williamr@2 | 7 |
// file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) |
williamr@2 | 8 |
// |
williamr@2 | 9 |
// typename indirect_reference<P>::type provides the type of *p. |
williamr@2 | 10 |
// |
williamr@2 | 11 |
// http://www.boost.org/libs/iterator/doc/pointee.html |
williamr@2 | 12 |
// |
williamr@2 | 13 |
|
williamr@2 | 14 |
# include <boost/detail/is_incrementable.hpp> |
williamr@2 | 15 |
# include <boost/iterator/iterator_traits.hpp> |
williamr@2 | 16 |
# include <boost/type_traits/remove_cv.hpp> |
williamr@2 | 17 |
# include <boost/mpl/eval_if.hpp> |
williamr@2 | 18 |
# include <boost/pointee.hpp> |
williamr@2 | 19 |
|
williamr@2 | 20 |
namespace boost { |
williamr@2 | 21 |
|
williamr@2 | 22 |
namespace detail |
williamr@2 | 23 |
{ |
williamr@2 | 24 |
template <class P> |
williamr@2 | 25 |
struct smart_ptr_reference |
williamr@2 | 26 |
{ |
williamr@2 | 27 |
typedef typename boost::pointee<P>::type& type; |
williamr@2 | 28 |
}; |
williamr@2 | 29 |
} |
williamr@2 | 30 |
|
williamr@2 | 31 |
template <class P> |
williamr@2 | 32 |
struct indirect_reference |
williamr@2 | 33 |
: mpl::eval_if< |
williamr@2 | 34 |
detail::is_incrementable<P> |
williamr@2 | 35 |
, iterator_reference<P> |
williamr@2 | 36 |
, detail::smart_ptr_reference<P> |
williamr@2 | 37 |
> |
williamr@2 | 38 |
{ |
williamr@2 | 39 |
}; |
williamr@2 | 40 |
|
williamr@2 | 41 |
} // namespace boost |
williamr@2 | 42 |
|
williamr@2 | 43 |
#endif // INDIRECT_REFERENCE_DWA200415_HPP |