File indexing completed on 2025-12-15 10:10:40
0001 #ifndef BOOST_POINTEE_DWA200415_HPP
0002 #define BOOST_POINTEE_DWA200415_HPP
0003
0004
0005
0006
0007
0008
0009
0010
0011
0012
0013
0014
0015
0016 #include <iterator>
0017 #include <type_traits>
0018
0019 #include <boost/detail/is_incrementable.hpp>
0020
0021 namespace boost {
0022 namespace detail {
0023
0024 template< typename P >
0025 struct smart_ptr_pointee
0026 {
0027 using type = typename P::element_type;
0028 };
0029
0030 template<
0031 typename Iterator,
0032 typename = typename std::remove_reference< decltype(*std::declval< Iterator& >()) >::type
0033 >
0034 struct iterator_pointee
0035 {
0036 using type = typename std::iterator_traits< Iterator >::value_type;
0037 };
0038
0039 template< typename Iterator, typename Reference >
0040 struct iterator_pointee< Iterator, const Reference >
0041 {
0042 using type = typename std::add_const< typename std::iterator_traits< Iterator >::value_type >::type;
0043 };
0044
0045 }
0046
0047 template< typename P >
0048 struct pointee :
0049 public std::conditional<
0050 detail::is_incrementable< P >::value,
0051 detail::iterator_pointee< P >,
0052 detail::smart_ptr_pointee< P >
0053 >::type
0054 {
0055 };
0056
0057 template< typename P >
0058 using pointee_t = typename pointee< P >::type;
0059
0060 }
0061
0062 #endif