return addressof & conjunction.

This commit is contained in:
Georgiy Guminov
2024-06-12 16:35:43 +03:00
committed by Georgy Guminov
parent 3b3d162575
commit c02def8acf
2 changed files with 21 additions and 19 deletions

View File

@ -17,6 +17,7 @@
#include <cstddef>
#include <boost/config.hpp>
#include <boost/type_traits/is_complete.hpp>
#include <boost/type_traits/conjunction.hpp>
#if !defined(BOOST_NO_CXX17_ITERATOR_TRAITS)
#include <iterator>
#endif
@ -57,56 +58,56 @@ no_type check(...);
template< typename T >
struct is_iterator_impl :
public boost::integral_constant<
public std::integral_constant<
bool,
sizeof(has_iterator_category_detail::check< T >(0)) == sizeof(has_iterator_category_detail::yes_type)
sizeof(has_iterator_category_detail::check<T>(0)) == sizeof(has_iterator_category_detail::yes_type)
>
{
};
template< typename T >
struct is_iterator_impl< T* > :
std::integral_constant<
bool
, boost::is_complete<T>::value && !std::is_function<T>::value
>
public boost::conjunction<
boost::is_complete<T>,
std::integral_constant<bool, !std::is_function<T>::value>
>::type
{
};
template< typename T, typename U >
struct is_iterator_impl< T U::* > :
public boost::false_type
public std::false_type
{
};
template< typename T >
struct is_iterator_impl< T& > :
public boost::false_type
struct is_iterator_impl<T&> :
public std::false_type
{
};
template< typename T, std::size_t N >
struct is_iterator_impl< T[N] > :
public boost::false_type
public std::false_type
{
};
#if !defined(BOOST_TT_HAS_WORKING_IS_COMPLETE)
template< typename T >
struct is_iterator_impl< T[] > :
public boost::false_type
public std::false_type
{
};
template< >
struct is_iterator_impl< void > :
public boost::false_type
public std::false_type
{
};
template< >
struct is_iterator_impl< void* > :
public boost::false_type
public std::false_type
{
};
#endif // !defined(BOOST_TT_HAS_WORKING_IS_COMPLETE)

View File

@ -8,10 +8,11 @@
#define BOOST_ITERATOR_FACADE_23022003THW_HPP
#include <boost/config.hpp>
#include <boost/core/addressof.hpp>
#include <boost/iterator/interoperable.hpp>
#include <boost/iterator/iterator_traits.hpp>
#include <boost/iterator/iterator_categories.hpp>
#include <boost/iterator/detail/facade_iterator_category.hpp>
#include <boost/mpl/eval_if.hpp>
@ -169,7 +170,7 @@ namespace iterators {
// Provides (r++)->foo()
value_type* operator->() const
{
return std::addressof(stored_value);
return boost::addressof(stored_value);
}
private:
@ -269,7 +270,7 @@ namespace iterators {
// Provides (r++)->foo()
value_type* operator->() const
{
return std::addressof(dereference_proxy.stored_value);
return boost::addressof(dereference_proxy.stored_value);
}
private:
@ -371,10 +372,10 @@ namespace iterators {
struct proxy
{
explicit proxy(Reference const & x) : m_ref(x) {}
Reference* operator->() { return std::addressof(m_ref); }
Reference* operator->() { return boost::addressof(m_ref); }
// This function is needed for MWCW and BCC, which won't call
// operator-> again automatically per 13.3.1.2 para 8
operator Reference*() { return std::addressof(m_ref); }
operator Reference*() { return boost::addressof(m_ref); }
Reference m_ref;
};
typedef proxy result_type;
@ -390,7 +391,7 @@ namespace iterators {
typedef Pointer result_type;
static result_type apply(T& x)
{
return std::addressof(x);
return boost::addressof(x);
}
};