From b5df827151a6d752168a59fa8c20c9ffd3766c0b Mon Sep 17 00:00:00 2001 From: Georqy Guminov Date: Sun, 23 Jun 2024 16:12:29 +0300 Subject: [PATCH] Fixes. Remove some Boost.MPL usages. Remove unused includes. --- build.jam | 1 - include/boost/iterator/counting_iterator.hpp | 2 - .../detail/facade_iterator_category.hpp | 24 +-- .../detail/type_traits/conjunction.hpp | 2 +- .../detail/type_traits/disjunction.hpp | 53 +++++++ .../iterator/detail/type_traits/negation.hpp | 53 +++++++ include/boost/iterator/filter_iterator.hpp | 4 +- include/boost/iterator/indirect_iterator.hpp | 2 - include/boost/iterator/interoperable.hpp | 9 +- include/boost/iterator/is_iterator.hpp | 3 +- include/boost/iterator/is_lvalue_iterator.hpp | 9 +- .../boost/iterator/is_readable_iterator.hpp | 9 +- include/boost/iterator/iterator_facade.hpp | 31 ++-- include/boost/iterator/new_iterator_tests.hpp | 147 ++++++++---------- include/boost/pending/iterator_tests.hpp | 4 +- test/detail/zip_iterator_test.ipp | 1 - test/iterator_adaptor_test.cpp | 6 +- test/permutation_iterator_test.cpp | 2 + test/range_distance_compat_test.cpp | 1 - 19 files changed, 224 insertions(+), 139 deletions(-) create mode 100644 include/boost/iterator/detail/type_traits/disjunction.hpp create mode 100644 include/boost/iterator/detail/type_traits/negation.hpp diff --git a/build.jam b/build.jam index 88bf37f..9f47fcb 100644 --- a/build.jam +++ b/build.jam @@ -16,7 +16,6 @@ constant boost_dependencies : /boost/mpl//boost_mpl /boost/optional//boost_optional /boost/smart_ptr//boost_smart_ptr - /boost/static_assert//boost_static_assert /boost/type_traits//boost_type_traits /boost/utility//boost_utility ; diff --git a/include/boost/iterator/counting_iterator.hpp b/include/boost/iterator/counting_iterator.hpp index 3e5a594..a05ca2c 100644 --- a/include/boost/iterator/counting_iterator.hpp +++ b/include/boost/iterator/counting_iterator.hpp @@ -33,8 +33,6 @@ namespace detail template struct is_numeric_impl { - // For a while, this wasn't true, but we rely on it below. This is a regression assert. - static_assert(std::is_integral::value, "std::is_integral is expected to be true"); # ifndef BOOST_NO_LIMITS_COMPILE_TIME_CONSTANTS diff --git a/include/boost/iterator/detail/facade_iterator_category.hpp b/include/boost/iterator/detail/facade_iterator_category.hpp index c6f48a8..7bac8d6 100644 --- a/include/boost/iterator/detail/facade_iterator_category.hpp +++ b/include/boost/iterator/detail/facade_iterator_category.hpp @@ -8,13 +8,13 @@ # include -# include // used in iterator_tag inheritance logic -# include # include # include # include +# include +# include # include // try to keep this last # ifdef BOOST_ITERATOR_REF_CONSTNESS_KILLS_WRITABILITY @@ -55,13 +55,13 @@ struct input_output_iterator_tag template struct iterator_writability_disabled # ifdef BOOST_ITERATOR_REF_CONSTNESS_KILLS_WRITABILITY // Adding Thomas' logic? - : mpl::or_< - is_const - , boost::detail::indirect_traits::is_reference_to_const - , is_const + : disjunction< + std::is_const + , std::integral_constant::value> + , std::is_const > # else - : is_const + : std::is_const # endif {}; @@ -77,21 +77,21 @@ struct iterator_writability_disabled template struct iterator_facade_default_category : mpl::eval_if< - mpl::and_< + conjunction< std::is_reference , std::is_convertible > , mpl::eval_if< std::is_convertible , mpl::identity - , mpl::if_< - std::is_convertible + , std::conditional< + std::is_convertible::value , std::bidirectional_iterator_tag , std::forward_iterator_tag > > , typename mpl::eval_if< - mpl::and_< + conjunction< std::is_convertible // check for readability @@ -107,7 +107,7 @@ struct iterator_facade_default_category // True iff T is convertible to an old-style iterator category. template struct is_iterator_category - : mpl::or_< + : disjunction< std::is_convertible , std::is_convertible > diff --git a/include/boost/iterator/detail/type_traits/conjunction.hpp b/include/boost/iterator/detail/type_traits/conjunction.hpp index bad757b..9f61f4f 100644 --- a/include/boost/iterator/detail/type_traits/conjunction.hpp +++ b/include/boost/iterator/detail/type_traits/conjunction.hpp @@ -50,4 +50,4 @@ using boost::conjunction; #endif -#endif // BOOST_ITERATOR_DETAIL_TYPE_TRAITS_CONJUNCTION_HPP_INCLUDED_ \ No newline at end of file +#endif // BOOST_ITERATOR_DETAIL_TYPE_TRAITS_CONJUNCTION_HPP_INCLUDED_ diff --git a/include/boost/iterator/detail/type_traits/disjunction.hpp b/include/boost/iterator/detail/type_traits/disjunction.hpp new file mode 100644 index 0000000..e0d2ad3 --- /dev/null +++ b/include/boost/iterator/detail/type_traits/disjunction.hpp @@ -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/disjunction.hpp + * + * This header contains definition of \c disjunction type trait. + */ + +#ifndef BOOST_ITERATOR_DETAIL_TYPE_TRAITS_DISJUNCTION_HPP_INCLUDED_ +#define BOOST_ITERATOR_DETAIL_TYPE_TRAITS_DISJUNCTION_HPP_INCLUDED_ + +#include +#include + +#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::disjunction; + +} // namespace detail +} // namespace iterator +} // namespace boost + +#else + +#include + +namespace boost { +namespace iterators { +namespace detail { + +using boost::disjunction; + +} // namespace detail +} // namespace iterator +} // namespace boost + +#endif + +#endif // BOOST_ITERATOR_DETAIL_TYPE_TRAITS_DISJUNCTION_HPP_INCLUDED_ diff --git a/include/boost/iterator/detail/type_traits/negation.hpp b/include/boost/iterator/detail/type_traits/negation.hpp new file mode 100644 index 0000000..9be4b6e --- /dev/null +++ b/include/boost/iterator/detail/type_traits/negation.hpp @@ -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/negation.hpp + * + * This header contains definition of \c negation type trait. + */ + +#ifndef BOOST_ITERATOR_DETAIL_TYPE_TRAITS_NEGATION_HPP_INCLUDED_ +#define BOOST_ITERATOR_DETAIL_TYPE_TRAITS_NEGATION_HPP_INCLUDED_ + +#include +#include + +#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::negation; + +} // namespace detail +} // namespace iterator +} // namespace boost + +#else + +#include + +namespace boost { +namespace iterators { +namespace detail { + +using boost::negation; + +} // namespace detail +} // namespace iterator +} // namespace boost + +#endif + +#endif // BOOST_ITERATOR_DETAIL_TYPE_TRAITS_NEGATION_HPP_INCLUDED_ diff --git a/include/boost/iterator/filter_iterator.hpp b/include/boost/iterator/filter_iterator.hpp index 187a92e..34549a8 100644 --- a/include/boost/iterator/filter_iterator.hpp +++ b/include/boost/iterator/filter_iterator.hpp @@ -30,11 +30,11 @@ namespace iterators { filter_iterator , Iterator , use_default - , typename mpl::if_< + , typename std::conditional< std::is_convertible< typename iterator_traversal::type , random_access_traversal_tag - > + >::value , bidirectional_traversal_tag , use_default >::type diff --git a/include/boost/iterator/indirect_iterator.hpp b/include/boost/iterator/indirect_iterator.hpp index f670839..ff02c42 100644 --- a/include/boost/iterator/indirect_iterator.hpp +++ b/include/boost/iterator/indirect_iterator.hpp @@ -14,7 +14,6 @@ #include -#include #include #include #include @@ -25,7 +24,6 @@ #ifdef BOOST_MPL_CFG_NO_HAS_XXX # include # include -# include # include #endif diff --git a/include/boost/iterator/interoperable.hpp b/include/boost/iterator/interoperable.hpp index 4bb8c89..b278eeb 100644 --- a/include/boost/iterator/interoperable.hpp +++ b/include/boost/iterator/interoperable.hpp @@ -9,9 +9,7 @@ # include -# include -# include - +# include # include // must appear last namespace boost { @@ -33,10 +31,7 @@ namespace iterators { // template struct is_interoperable - : std::integral_constant< - bool - , std::is_convertible< A, B >::value || std::is_convertible< B, A >::value - > + : detail::disjunction, std::is_convertible> { }; diff --git a/include/boost/iterator/is_iterator.hpp b/include/boost/iterator/is_iterator.hpp index 2beba22..d9830a0 100644 --- a/include/boost/iterator/is_iterator.hpp +++ b/include/boost/iterator/is_iterator.hpp @@ -18,6 +18,7 @@ #include #include #include +#include #if !defined(BOOST_NO_CXX17_ITERATOR_TRAITS) #include #endif @@ -69,7 +70,7 @@ template< typename T > struct is_iterator_impl< T* > : public conjunction< boost::is_complete, - std::integral_constant::value> + negation< std::is_function< T > > >::type { }; diff --git a/include/boost/iterator/is_lvalue_iterator.hpp b/include/boost/iterator/is_lvalue_iterator.hpp index 26eccb2..8dd06ef 100644 --- a/include/boost/iterator/is_lvalue_iterator.hpp +++ b/include/boost/iterator/is_lvalue_iterator.hpp @@ -7,7 +7,6 @@ #include #include -#include #include #include @@ -84,7 +83,7 @@ namespace detail struct is_lvalue_iterator_impl { template - struct rebind : boost::mpl::false_ + struct rebind : std::false_type {}; }; @@ -93,7 +92,7 @@ namespace detail struct is_lvalue_iterator_impl { template - struct rebind : boost::mpl::false_ + struct rebind : std::false_type {}; }; @@ -101,7 +100,7 @@ namespace detail struct is_lvalue_iterator_impl { template - struct rebind : boost::mpl::false_ + struct rebind : std::false_type {}; }; @@ -109,7 +108,7 @@ namespace detail struct is_lvalue_iterator_impl { template - struct rebind : boost::mpl::false_ + struct rebind : std::false_type {}; }; #endif diff --git a/include/boost/iterator/is_readable_iterator.hpp b/include/boost/iterator/is_readable_iterator.hpp index ed6db05..da99a44 100644 --- a/include/boost/iterator/is_readable_iterator.hpp +++ b/include/boost/iterator/is_readable_iterator.hpp @@ -4,7 +4,6 @@ #ifndef IS_READABLE_ITERATOR_DWA2003112_HPP # define IS_READABLE_ITERATOR_DWA2003112_HPP -#include #include #include @@ -54,7 +53,7 @@ namespace detail struct is_readable_iterator_impl { template - struct rebind : boost::mpl::false_ + struct rebind : std::false_type {}; }; @@ -63,7 +62,7 @@ namespace detail struct is_readable_iterator_impl { template - struct rebind : boost::mpl::false_ + struct rebind : std::false_type {}; }; @@ -71,7 +70,7 @@ namespace detail struct is_readable_iterator_impl { template - struct rebind : boost::mpl::false_ + struct rebind : std::false_type {}; }; @@ -79,7 +78,7 @@ namespace detail struct is_readable_iterator_impl { template - struct rebind : boost::mpl::false_ + struct rebind : std::false_type {}; }; #endif diff --git a/include/boost/iterator/iterator_facade.hpp b/include/boost/iterator/iterator_facade.hpp index bc31fbe..110f883 100644 --- a/include/boost/iterator/iterator_facade.hpp +++ b/include/boost/iterator/iterator_facade.hpp @@ -14,11 +14,11 @@ #include #include #include +#include +#include #include -#include -#include -#include + #include #include #include @@ -28,6 +28,7 @@ #include #include +#include #include // this goes last namespace boost { @@ -82,7 +83,7 @@ namespace iterators { > struct enable_if_interoperable_and_random_access_traversal : public std::enable_if< - mpl::and_< + detail::conjunction< is_interoperable< Facade1, Facade2 > , is_traversal_at_least< typename iterator_category< Facade1 >::type, random_access_traversal_tag > , is_traversal_at_least< typename iterator_category< Facade2 >::type, random_access_traversal_tag > @@ -278,7 +279,6 @@ namespace iterators { }; # ifdef BOOST_NO_TEMPLATE_PARTIAL_SPECIALIZATION - template struct is_non_proxy_reference_impl { @@ -299,8 +299,9 @@ namespace iterators { template struct is_non_proxy_reference - : mpl::bool_< - is_non_proxy_reference_impl::value + : std::integral_constant< + bool + , is_non_proxy_reference_impl::value > {}; # else @@ -332,7 +333,7 @@ namespace iterators { template struct postfix_increment_result : mpl::eval_if< - mpl::and_< + detail::conjunction< // A proxy is only needed for readable iterators std::is_convertible< Reference @@ -346,7 +347,7 @@ namespace iterators { // No multipass iterator can have values that disappear // before positions can be re-visited - , mpl::not_< + , detail::negation< std::is_convertible< typename iterator_category_to_traversal::type , forward_traversal_tag @@ -430,8 +431,8 @@ namespace iterators { // proxy, or whether it can simply return a copy of the value_type. template struct use_operator_brackets_proxy - : mpl::not_< - mpl::and_< + : detail::negation< + detail::conjunction< // Really we want an is_copy_constructible trait here, // but is_POD will have to suffice in the meantime. std::is_standard_layout @@ -452,13 +453,13 @@ namespace iterators { }; template - operator_brackets_proxy make_operator_brackets_result(Iterator const& iter, mpl::true_) + operator_brackets_proxy make_operator_brackets_result(Iterator const& iter, std::true_type) { return operator_brackets_proxy(iter); } template - typename Iterator::value_type make_operator_brackets_result(Iterator const& iter, mpl::false_) + typename Iterator::value_type make_operator_brackets_result(Iterator const& iter, std::false_type) { return *iter; } @@ -763,11 +764,11 @@ namespace iterators { typename boost::iterators::detail::operator_brackets_result::type operator[](difference_type n) const { - typedef boost::iterators::detail::use_operator_brackets_proxy use_proxy; + const auto use_proxy = boost::iterators::detail::use_operator_brackets_proxy::value; return boost::iterators::detail::make_operator_brackets_result( this->derived() + n - , use_proxy() + , std::integral_constant{} ); } diff --git a/include/boost/iterator/new_iterator_tests.hpp b/include/boost/iterator/new_iterator_tests.hpp index 6a6bf57..90fde10 100644 --- a/include/boost/iterator/new_iterator_tests.hpp +++ b/include/boost/iterator/new_iterator_tests.hpp @@ -1,5 +1,5 @@ #ifndef BOOST_NEW_ITERATOR_TESTS_HPP -# define BOOST_NEW_ITERATOR_TESTS_HPP +#define BOOST_NEW_ITERATOR_TESTS_HPP // // Copyright (c) David Abrahams 2001. @@ -28,52 +28,45 @@ // 04 Feb 2001 Added lvalue test, corrected preconditions // (David Abrahams) -# include -# include -# include // for detail::dummy_constructor -# include -# include -# include -# include +#include // for detail::dummy_constructor +#include +#include +#include +#include +#include -# include -# include -# include +#include +#include +#include +#include namespace boost { - // Do separate tests for *i++ so we can treat, e.g., smart pointers, // as readable and/or writable iterators. template -void readable_iterator_traversal_test(Iterator i1, T v, mpl::true_) -{ - T v2(*i1++); - BOOST_TEST(v == v2); +void readable_iterator_traversal_test(Iterator i1, T v, std::true_type) { + T v2(*i1++); + BOOST_TEST(v == v2); } template -void readable_iterator_traversal_test(const Iterator i1, T v, mpl::false_) -{} +void readable_iterator_traversal_test(const Iterator i1, T v, std::false_type) {} template -void writable_iterator_traversal_test(Iterator i1, T v, mpl::true_) -{ - ++i1; // we just wrote into that position - *i1++ = v; - Iterator x(i1++); - (void)x; +void writable_iterator_traversal_test(Iterator i1, T v, std::true_type) { + ++i1; // we just wrote into that position + *i1++ = v; + Iterator x(i1++); + (void)x; } template -void writable_iterator_traversal_test(const Iterator i1, T v, mpl::false_) -{} - +void writable_iterator_traversal_test(const Iterator i1, T v, std::false_type) {} // Preconditions: *i == v template -void readable_iterator_test(const Iterator i1, T v) -{ +void readable_iterator_test(const Iterator i1, T v) { Iterator i2(i1); // Copy Constructible typedef typename std::iterator_traits::reference ref_t; ref_t r1 = *i1; @@ -83,33 +76,35 @@ void readable_iterator_test(const Iterator i1, T v) BOOST_TEST(v1 == v); BOOST_TEST(v2 == v); -# if !BOOST_WORKAROUND(__MWERKS__, <= 0x2407) - readable_iterator_traversal_test(i1, v, detail::is_postfix_incrementable()); +#if !BOOST_WORKAROUND(__MWERKS__, <= 0x2407) + readable_iterator_traversal_test( + i1, v, + std::integral_constant< + bool, detail::is_postfix_incrementable::value>{}); // I think we don't really need this as it checks the same things as // the above code. - static_assert(is_readable_iterator::value, "Iterator must be readable."); -# endif + static_assert(is_readable_iterator::value, + "Iterator must be readable."); +#endif } template -void writable_iterator_test(Iterator i, T v, T v2) -{ +void writable_iterator_test(Iterator i, T v, T v2) { Iterator i2(i); // Copy Constructible *i2 = v; -# if !BOOST_WORKAROUND(__MWERKS__, <= 0x2407) +#if !BOOST_WORKAROUND(__MWERKS__, <= 0x2407) writable_iterator_traversal_test( - i, v2, mpl::and_< - detail::is_incrementable - , detail::is_postfix_incrementable + i, v2, + iterators::detail::conjunction< + std::integral_constant::value>, + std::integral_constant::value> >()); -# endif +#endif } -template -void swappable_iterator_test(Iterator i, Iterator j) -{ +template void swappable_iterator_test(Iterator i, Iterator j) { Iterator i2(i), j2(j); typename std::iterator_traits::value_type bi = *i, bj = *j; iter_swap(i2, j2); @@ -118,51 +113,50 @@ void swappable_iterator_test(Iterator i, Iterator j) } template -void constant_lvalue_iterator_test(Iterator i, T v1) -{ +void constant_lvalue_iterator_test(Iterator i, T v1) { Iterator i2(i); typedef typename std::iterator_traits::value_type value_type; typedef typename std::iterator_traits::reference reference; - static_assert( - std::is_same::value, - "reference type must be the same as const value_type& for constant lvalue iterator." - ); - const T& v2 = *i2; + static_assert(std::is_same::value, + "reference type must be the same as const value_type& for " + "constant lvalue iterator."); + const T &v2 = *i2; BOOST_TEST(v1 == v2); -# ifndef BOOST_NO_LVALUE_RETURN_DETECTION - static_assert(is_lvalue_iterator::value, "Iterator must be lvalue."); - static_assert(!is_non_const_lvalue_iterator::value, "Iterator must be const."); -# endif +#ifndef BOOST_NO_LVALUE_RETURN_DETECTION + static_assert(is_lvalue_iterator::value, + "Iterator must be lvalue."); + static_assert(!is_non_const_lvalue_iterator::value, + "Iterator must be const."); +#endif } template -void non_const_lvalue_iterator_test(Iterator i, T v1, T v2) -{ +void non_const_lvalue_iterator_test(Iterator i, T v1, T v2) { Iterator i2(i); typedef typename std::iterator_traits::value_type value_type; typedef typename std::iterator_traits::reference reference; - static_assert( - std::is_same::value, - "reference type must be the same as value_type& for non-constant lvalue iterator." - ); - T& v3 = *i2; + static_assert(std::is_same::value, + "reference type must be the same as value_type& for " + "non-constant lvalue iterator."); + T &v3 = *i2; BOOST_TEST(v1 == v3); // A non-const lvalue iterator is not necessarily writable, but we // are assuming the value_type is assignable here *i = v2; - T& v4 = *i2; + T &v4 = *i2; BOOST_TEST(v2 == v4); -# ifndef BOOST_NO_LVALUE_RETURN_DETECTION - static_assert(is_lvalue_iterator::value, "Iterator must be lvalue."); - static_assert(is_non_const_lvalue_iterator::value, "Iterator must be non-const."); -# endif +#ifndef BOOST_NO_LVALUE_RETURN_DETECTION + static_assert(is_lvalue_iterator::value, + "Iterator must be lvalue."); + static_assert(is_non_const_lvalue_iterator::value, + "Iterator must be non-const."); +#endif } template -void forward_readable_iterator_test(Iterator i, Iterator j, T val1, T val2) -{ +void forward_readable_iterator_test(Iterator i, Iterator j, T val1, T val2) { Iterator i2; Iterator i3(i); i2 = i; @@ -183,8 +177,7 @@ void forward_readable_iterator_test(Iterator i, Iterator j, T val1, T val2) } template -void forward_swappable_iterator_test(Iterator i, Iterator j, T val1, T val2) -{ +void forward_swappable_iterator_test(Iterator i, Iterator j, T val1, T val2) { forward_readable_iterator_test(i, j, val1, val2); Iterator i2 = i; ++i2; @@ -194,8 +187,7 @@ void forward_swappable_iterator_test(Iterator i, Iterator j, T val1, T val2) // bidirectional // Preconditions: *i == v1, *++i == v2 template -void bidirectional_readable_iterator_test(Iterator i, T v1, T v2) -{ +void bidirectional_readable_iterator_test(Iterator i, T v1, T v2) { Iterator j(i); ++j; forward_readable_iterator_test(i, j, v1, v2); @@ -224,14 +216,12 @@ void bidirectional_readable_iterator_test(Iterator i, T v1, T v2) // random access // Preconditions: [i,i+N) is a valid range template -void random_access_readable_iterator_test(Iterator i, int N, TrueVals vals) -{ +void random_access_readable_iterator_test(Iterator i, int N, TrueVals vals) { bidirectional_readable_iterator_test(i, vals[0], vals[1]); const Iterator j = i; int c; - for (c = 0; c < N-1; ++c) - { + for (c = 0; c < N - 1; ++c) { BOOST_TEST(i == j + c); BOOST_TEST(*i == vals[c]); typename std::iterator_traits::value_type x = j[c]; @@ -246,8 +236,7 @@ void random_access_readable_iterator_test(Iterator i, int N, TrueVals vals) } Iterator k = j + N - 1; - for (c = 0; c < N-1; ++c) - { + for (c = 0; c < N - 1; ++c) { BOOST_TEST(i == k - c); BOOST_TEST(*i == vals[N - 1 - c]); typename std::iterator_traits::value_type x = j[N - 1 - c]; @@ -264,6 +253,6 @@ void random_access_readable_iterator_test(Iterator i, int N, TrueVals vals) } // namespace boost -# include +#include #endif // BOOST_NEW_ITERATOR_TESTS_HPP diff --git a/include/boost/pending/iterator_tests.hpp b/include/boost/pending/iterator_tests.hpp index 1b1c50b..6c50b9d 100644 --- a/include/boost/pending/iterator_tests.hpp +++ b/include/boost/pending/iterator_tests.hpp @@ -142,8 +142,8 @@ template struct lvalue_test # endif static_assert(std::is_reference::value, "reference must be a reference type."); static_assert( - std::is_same::value || std::is_same::value, - "reference must either be a reference to value_type or constant reference to value_type." + std::is_same::value || std::is_same::value, + "reference must either be a reference to value_type or constant reference to value_type." ); } }; diff --git a/test/detail/zip_iterator_test.ipp b/test/detail/zip_iterator_test.ipp index 39c223c..7e0d2f7 100644 --- a/test/detail/zip_iterator_test.ipp +++ b/test/detail/zip_iterator_test.ipp @@ -8,7 +8,6 @@ #include -#include #include #include #include diff --git a/test/iterator_adaptor_test.cpp b/test/iterator_adaptor_test.cpp index 81f2e35..4305d18 100644 --- a/test/iterator_adaptor_test.cpp +++ b/test/iterator_adaptor_test.cpp @@ -210,8 +210,8 @@ main() test = static_assert_same::value; #if !BOOST_WORKAROUND(__MWERKS__, <= 0x2407) static_assert( - std::is_convertible::value, - "Iter1::iterator_category must be convertible to std::random_access_iterator_tag." + std::is_convertible::value, + "Iterator must have a random access category." ); #endif } @@ -225,7 +225,7 @@ main() #if !BOOST_WORKAROUND(__MWERKS__, <= 0x2407) static_assert(boost::is_readable_iterator::value, "Iter1 is expected to be readable."); # ifndef BOOST_NO_LVALUE_RETURN_DETECTION - static_assert(boost::is_lvalue_iterator::value, "Iter1 is expected to be lvalue."); + static_assert(boost::is_lvalue_iterator::value, "Iter1 is expected to be lvalue iterator."); # endif #endif diff --git a/test/permutation_iterator_test.cpp b/test/permutation_iterator_test.cpp index 619605f..db601e8 100644 --- a/test/permutation_iterator_test.cpp +++ b/test/permutation_iterator_test.cpp @@ -43,6 +43,8 @@ void permutation_test() const int element_range_size = 10; const int index_size = 7; + static_assert(index_size < element_range_size, "The permutation of some elements is checked."); + element_range_type elements( element_range_size ); for( element_range_type::iterator el_it = elements.begin(); el_it != elements.end(); ++el_it ) { *el_it = std::distance(elements.begin(), el_it); } diff --git a/test/range_distance_compat_test.cpp b/test/range_distance_compat_test.cpp index 5501810..ef7e301 100644 --- a/test/range_distance_compat_test.cpp +++ b/test/range_distance_compat_test.cpp @@ -5,7 +5,6 @@ // http://www.boost.org/LICENSE_1_0.txt) #include -#include #include #include