Removed dependency on Boost.Conversion in tests.

This reduces the minimum supported compilers versions.
This commit is contained in:
Andrey Semashev
2023-11-17 04:25:29 +03:00
parent 80bb1ac9e4
commit a9dabd3c65
2 changed files with 8 additions and 7 deletions

View File

@@ -22,7 +22,6 @@
# include <iterator>
# include <boost/static_assert.hpp>
# include <boost/concept_archetype.hpp> // for detail::dummy_constructor
# include <boost/implicit_cast.hpp>
# include <boost/core/ignore_unused.hpp>
# include <boost/core/lightweight_test.hpp>
# include <boost/type_traits/is_same.hpp>
@@ -223,12 +222,15 @@ void random_access_iterator_test(Iterator i, int N, TrueVals vals)
int c;
typedef typename std::iterator_traits<Iterator>::value_type value_type;
boost::ignore_unused<value_type>();
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<value_type>(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<value_type>(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);