From 741a627b736ba81fe0054e5bf373141b04a8a597 Mon Sep 17 00:00:00 2001 From: Georgy Guminov Date: Sat, 25 Jan 2025 12:13:05 +0300 Subject: [PATCH] Replace testers with standard metafunctions. --- .../iterator/detail/any_conversion_eater.hpp | 21 ------------------ .../boost/iterator/is_readable_iterator.hpp | 7 ------ include/boost/pointee.hpp | 22 ++++--------------- 3 files changed, 4 insertions(+), 46 deletions(-) delete mode 100644 include/boost/iterator/detail/any_conversion_eater.hpp diff --git a/include/boost/iterator/detail/any_conversion_eater.hpp b/include/boost/iterator/detail/any_conversion_eater.hpp deleted file mode 100644 index 429421f..0000000 --- a/include/boost/iterator/detail/any_conversion_eater.hpp +++ /dev/null @@ -1,21 +0,0 @@ -// Copyright David Abrahams 2003. Use, modification and distribution is -// subject to the Boost Software License, Version 1.0. (See accompanying -// file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) -#ifndef ANY_CONVERSION_EATER_DWA20031117_HPP -# define ANY_CONVERSION_EATER_DWA20031117_HPP - -namespace boost { -namespace iterators { -namespace detail { - -// This type can be used in traits to "eat" up the one user-defined -// implicit conversion allowed. -struct any_conversion_eater -{ - template - any_conversion_eater(T const&); -}; - -}}} // namespace boost::iterators::detail - -#endif // ANY_CONVERSION_EATER_DWA20031117_HPP diff --git a/include/boost/iterator/is_readable_iterator.hpp b/include/boost/iterator/is_readable_iterator.hpp index 8d7a2c5..698f2ff 100644 --- a/include/boost/iterator/is_readable_iterator.hpp +++ b/include/boost/iterator/is_readable_iterator.hpp @@ -6,8 +6,6 @@ #include -#include - #include #include @@ -22,9 +20,6 @@ namespace detail template struct is_readable_iterator_impl { - static char tester(typename std::add_lvalue_reference::type, int); - static char (& tester(any_conversion_eater, ...) )[2]; - template struct rebind : std::is_convertible< decltype(*std::declval()) @@ -33,8 +28,6 @@ namespace detail {}; }; -#undef BOOST_READABLE_PRESERVER - // // void specializations to handle std input and output iterators // diff --git a/include/boost/pointee.hpp b/include/boost/pointee.hpp index b177e73..e040894 100644 --- a/include/boost/pointee.hpp +++ b/include/boost/pointee.hpp @@ -34,25 +34,11 @@ namespace detail struct iterator_pointee { typedef typename std::iterator_traits::value_type value_type; - - struct impl - { - template - static char test(T const&); - - static char (& test(value_type&) )[2]; - - static Iterator& x; - }; - - BOOST_STATIC_CONSTANT(bool, is_constant = sizeof(impl::test(*impl::x)) == 1); - + typedef typename std::conditional< -# if BOOST_WORKAROUND(BOOST_BORLANDC, BOOST_TESTED_AT(0x551)) - ::boost::detail::iterator_pointee::is_constant -# else - is_constant -# endif + std::is_const< + typename std::remove_reference())>::type + >::value , typename std::add_const::type , value_type >::type type;