abstract conjunction.

This commit is contained in:
Georgiy Guminov
2024-06-12 17:14:21 +03:00
committed by Georgy Guminov
parent c02def8acf
commit 01fd35e9f8
3 changed files with 57 additions and 4 deletions

View File

@ -0,0 +1,53 @@
/*
* Distributed under the Boost Software License, Version 1.0.
* (See accompanying file LICENSE_1_0.txt or copy at
* https://www.boost.org/LICENSE_1_0.txt)
*
* Copyright (c) 2024 Georgiy Guminov
*/
/*!
* \file iterator/detail/type_traits/conjunction.hpp
*
* This header contains definition of \c conjunction type trait.
*/
#ifndef BOOST_ITERATOR_DETAIL_TYPE_TRAITS_CONJUNCTION_HPP_INCLUDED_
#define BOOST_ITERATOR_DETAIL_TYPE_TRAITS_CONJUNCTION_HPP_INCLUDED_
#include <type_traits>
#include <boost/config.hpp>
#ifdef BOOST_HAS_PRAGMA_ONCE
#pragma once
#endif
#if (defined(__cpp_lib_logical_traits) && (__cpp_lib_logical_traits >= 201510l)) || \
(defined(BOOST_MSSTL_VERSION) && (BOOST_MSSTL_VERSION >= 140) && (_MSC_FULL_VER >= 190023918) && (BOOST_CXX_VERSION >= 201703l))
namespace boost {
namespace iterators {
namespace detail {
using std::conjunction;
} // namespace detail
} // namespace iterator
} // namespace boost
#else
#include <boost/type_traits/conjunction.hpp>
namespace boost {
namespace iterators {
namespace detail {
using boost::conjunction;
} // namespace detail
} // namespace iterator
} // namespace boost
#endif
#endif // BOOST_ITERATOR_DETAIL_TYPE_TRAITS_CONJUNCTION_HPP_INCLUDED_

View File

@ -17,7 +17,7 @@
#include <cstddef>
#include <boost/config.hpp>
#include <boost/type_traits/is_complete.hpp>
#include <boost/type_traits/conjunction.hpp>
#include <boost/iterator/detail/type_traits/conjunction.hpp>
#if !defined(BOOST_NO_CXX17_ITERATOR_TRAITS)
#include <iterator>
#endif
@ -67,7 +67,7 @@ struct is_iterator_impl :
template< typename T >
struct is_iterator_impl< T* > :
public boost::conjunction<
public conjunction<
boost::is_complete<T>,
std::integral_constant<bool, !std::is_function<T>::value>
>::type

View File

@ -937,8 +937,8 @@ namespace iterators {
BOOST_ITERATOR_FACADE_INTEROP_RANDOM_ACCESS_HEAD(inline, op, result_type) \
{ \
using boost::iterators::detail::is_traversal_at_least; \
using Derived1IterCat = typename iterator_category<Derived1>::type; \
using Derived2IterCat = typename iterator_category<Derived2>::type; \
typedef typename iterator_category<Derived1>::type Derived1IterCat; \
typedef typename iterator_category<Derived2>::type Derived2IterCat; \
/* For those compilers that do not support enable_if */ \
static_assert( \
is_interoperable<Derived1, Derived2>::value && \