Removed MPL usage from pointee and indirect_reference.

This commit is contained in:
Andrey Semashev
2025-01-26 17:57:47 +03:00
parent d6297a553b
commit bcf94f9e5d
2 changed files with 47 additions and 49 deletions

View File

@@ -1,5 +1,5 @@
#ifndef INDIRECT_REFERENCE_DWA200415_HPP
# define INDIRECT_REFERENCE_DWA200415_HPP
#define INDIRECT_REFERENCE_DWA200415_HPP
//
// Copyright David Abrahams 2004. Use, modification and distribution is
@@ -11,29 +11,30 @@
// http://www.boost.org/libs/iterator/doc/pointee.html
//
# include <boost/detail/is_incrementable.hpp>
# include <boost/iterator/iterator_traits.hpp>
# include <boost/mpl/eval_if.hpp>
# include <boost/pointee.hpp>
#include <boost/detail/is_incrementable.hpp>
#include <boost/iterator/iterator_traits.hpp>
#include <boost/pointee.hpp>
#include <type_traits>
namespace boost {
namespace detail {
namespace detail
template< typename P >
struct smart_ptr_reference
{
template <class P>
struct smart_ptr_reference
{
typedef typename boost::pointee<P>::type& type;
};
}
using type = typename boost::pointee<P>::type&;
};
template <class P>
struct indirect_reference
: mpl::eval_if<
detail::is_incrementable<P>
, iterator_reference<P>
, detail::smart_ptr_reference<P>
>
} // namespace detail
template< typename P >
struct indirect_reference :
std::conditional<
detail::is_incrementable<P>::value,
iterator_reference<P>,
detail::smart_ptr_reference<P>
>::type
{
};