Added pointee_t alias.

This commit is contained in:
Andrey Semashev 2025-02-07 01:26:33 +03:00
parent d35869cd25
commit 8998179e9d

View File

@ -1,5 +1,5 @@
#ifndef POINTEE_DWA200415_HPP #ifndef BOOST_POINTEE_DWA200415_HPP
#define POINTEE_DWA200415_HPP #define BOOST_POINTEE_DWA200415_HPP
// //
// Copyright David Abrahams 2004. Use, modification and distribution is // Copyright David Abrahams 2004. Use, modification and distribution is
@ -13,12 +13,11 @@
// http://www.boost.org/libs/iterator/doc/pointee.html // http://www.boost.org/libs/iterator/doc/pointee.html
// //
#include <boost/detail/is_incrementable.hpp>
#include <boost/iterator/iterator_traits.hpp>
#include <iterator> #include <iterator>
#include <type_traits> #include <type_traits>
#include <boost/detail/is_incrementable.hpp>
namespace boost { namespace boost {
namespace detail { namespace detail {
@ -28,7 +27,10 @@ struct smart_ptr_pointee
using type = typename P::element_type; using type = typename P::element_type;
}; };
template< typename Iterator, typename = typename std::remove_reference<decltype(*std::declval<Iterator&>())>::type > template<
typename Iterator,
typename = typename std::remove_reference< decltype(*std::declval< Iterator& >()) >::type
>
struct iterator_pointee struct iterator_pointee
{ {
using type = typename std::iterator_traits< Iterator >::value_type; using type = typename std::iterator_traits< Iterator >::value_type;
@ -52,6 +54,9 @@ struct pointee :
{ {
}; };
template< typename P >
using pointee_t = typename pointee< P >::type;
} // namespace boost } // namespace boost
#endif // POINTEE_DWA200415_HPP #endif // BOOST_POINTEE_DWA200415_HPP