From a9dabd3c657e422fb3487fe9bc5cfddf2ae82dd9 Mon Sep 17 00:00:00 2001 From: Andrey Semashev Date: Fri, 17 Nov 2023 04:25:29 +0300 Subject: [PATCH] Removed dependency on Boost.Conversion in tests. This reduces the minimum supported compilers versions. --- include/boost/pending/iterator_tests.hpp | 10 ++++++---- test/iterator_facade.cpp | 5 ++--- 2 files changed, 8 insertions(+), 7 deletions(-) diff --git a/include/boost/pending/iterator_tests.hpp b/include/boost/pending/iterator_tests.hpp index 46dc420..a683683 100644 --- a/include/boost/pending/iterator_tests.hpp +++ b/include/boost/pending/iterator_tests.hpp @@ -22,7 +22,6 @@ # include # include # include // for detail::dummy_constructor -# include # include # include # include @@ -223,12 +222,15 @@ void random_access_iterator_test(Iterator i, int N, TrueVals vals) int c; typedef typename std::iterator_traits::value_type value_type; - boost::ignore_unused(); + struct local + { + static value_type to_value_type(value_type v) { return v; } + }; for (c = 0; c < N-1; ++c) { BOOST_TEST(i == j + c); BOOST_TEST(*i == vals[c]); - BOOST_TEST(*i == boost::implicit_cast(j[c])); + BOOST_TEST(*i == local::to_value_type(j[c])); BOOST_TEST(*i == *(j + c)); BOOST_TEST(*i == *(c + j)); ++i; @@ -242,7 +244,7 @@ void random_access_iterator_test(Iterator i, int N, TrueVals vals) for (c = 0; c < N-1; ++c) { BOOST_TEST(i == k - c); BOOST_TEST(*i == vals[N - 1 - c]); - BOOST_TEST(*i == boost::implicit_cast(j[N - 1 - c])); + BOOST_TEST(*i == local::to_value_type(j[N - 1 - c])); Iterator q = k - c; boost::ignore_unused(q); BOOST_TEST(*i == *q); diff --git a/test/iterator_facade.cpp b/test/iterator_facade.cpp index 79c0161..7351dd3 100644 --- a/test/iterator_facade.cpp +++ b/test/iterator_facade.cpp @@ -8,7 +8,6 @@ #include #include -#include #include #include @@ -188,12 +187,12 @@ struct derived : base virtual void assign(const base &b) { - state = boost::polymorphic_cast(&b)->state; + state = dynamic_cast(b).state; } virtual bool equal(const base &b) const { - return state == boost::polymorphic_cast(&b)->state; + return state == dynamic_cast(b).state; } int state;