Remove more workarounds.

This commit is contained in:
Georgy Guminov
2025-01-25 10:27:32 +03:00
parent 5a4ba24d36
commit 8d080c6c58
21 changed files with 22 additions and 286 deletions

View File

@@ -29,12 +29,6 @@ namespace iterators {
} }
} }
#if BOOST_WORKAROUND(BOOST_GCC_VERSION, >= 40600)
// type-limits warning issued below when n is an unsigned integral
#pragma GCC diagnostic push
#pragma GCC diagnostic ignored "-Wtype-limits"
#endif
template <typename BidirectionalIterator, typename Distance> template <typename BidirectionalIterator, typename Distance>
inline BOOST_CXX14_CONSTEXPR void inline BOOST_CXX14_CONSTEXPR void
advance_impl( advance_impl(
@@ -57,10 +51,6 @@ namespace iterators {
} }
} }
#if BOOST_WORKAROUND(BOOST_GCC_VERSION, >= 40600)
#pragma GCC diagnostic pop
#endif
template <typename RandomAccessIterator, typename Distance> template <typename RandomAccessIterator, typename Distance>
inline BOOST_CXX14_CONSTEXPR void inline BOOST_CXX14_CONSTEXPR void
advance_impl( advance_impl(

View File

@@ -26,8 +26,7 @@
// libs/iterator/test/constant_iterator_arrow.cpp fails to compile // libs/iterator/test/constant_iterator_arrow.cpp fails to compile
// because the operator-> return is improperly deduced as a non-const // because the operator-> return is improperly deduced as a non-const
// pointer. // pointer.
#if 1 || defined(BOOST_NO_TEMPLATE_PARTIAL_SPECIALIZATION) \ #if 1
|| BOOST_WORKAROUND(BOOST_BORLANDC, BOOST_TESTED_AT(0x531))
// Recall that in general, compilers without partial specialization // Recall that in general, compilers without partial specialization
// can't strip constness. Consider counting_iterator, which normally // can't strip constness. Consider counting_iterator, which normally
@@ -46,39 +45,4 @@
#endif #endif
#if (BOOST_WORKAROUND(BOOST_INTEL_CXX_VERSION, <= 700) && defined(_MSC_VER)) \
|| BOOST_WORKAROUND(__SUNPRO_CC, BOOST_TESTED_AT(0x590))
# define BOOST_NO_LVALUE_RETURN_DETECTION
# if 0 // test code
struct v {};
typedef char (&no)[3];
template <class T>
no foo(T const&, ...);
template <class T>
char foo(T&, int);
struct value_iterator
{
v operator*() const;
};
template <class T>
struct lvalue_deref_helper
{
static T& x;
enum { value = (sizeof(foo(*x,0)) == 1) };
};
int z2[(lvalue_deref_helper<v*>::value == 1) ? 1 : -1];
int z[(lvalue_deref_helper<value_iterator>::value) == 1 ? -1 : 1 ];
# endif
#endif
// no include guard; multiple inclusion intended // no include guard; multiple inclusion intended

View File

@@ -11,7 +11,7 @@
// 23/02/03 thw // 23/02/03 thw
// //
#undef BOOST_NO_LVALUE_RETURN_DETECTION #undef BOOST_ITERATOR_REF_CONSTNESS_KILLS_WRITABILITY
#ifdef BOOST_ITERATOR_CONFIG_DEF #ifdef BOOST_ITERATOR_CONFIG_DEF
# undef BOOST_ITERATOR_CONFIG_DEF # undef BOOST_ITERATOR_CONFIG_DEF

View File

@@ -77,7 +77,7 @@ struct iterator_writability_disabled
template <class Traversal, class ValueParam, class Reference> template <class Traversal, class ValueParam, class Reference>
struct iterator_facade_default_category struct iterator_facade_default_category
: mpl::eval_if< : mpl::eval_if<
conjunction< detail::conjunction<
std::is_reference<Reference> std::is_reference<Reference>
, std::is_convertible<Traversal,forward_traversal_tag> , std::is_convertible<Traversal,forward_traversal_tag>
> >
@@ -90,8 +90,8 @@ struct iterator_facade_default_category
, std::forward_iterator_tag , std::forward_iterator_tag
> >
> >
, typename mpl::eval_if< , mpl::eval_if<
conjunction< detail::conjunction<
std::is_convertible<Traversal, single_pass_traversal_tag> std::is_convertible<Traversal, single_pass_traversal_tag>
// check for readability // check for readability
@@ -143,9 +143,7 @@ struct iterator_category_with_traversal
static_assert(is_iterator_category<Category>::value, "Category must be an STL iterator category."); static_assert(is_iterator_category<Category>::value, "Category must be an STL iterator category.");
static_assert(!is_iterator_category<Traversal>::value, "Traversal must not be an STL iterator category."); static_assert(!is_iterator_category<Traversal>::value, "Traversal must not be an STL iterator category.");
static_assert(!is_iterator_traversal<Category>::value, "Category must not be a traversal tag."); static_assert(!is_iterator_traversal<Category>::value, "Category must not be a traversal tag.");
# if !BOOST_WORKAROUND(BOOST_MSVC, BOOST_TESTED_AT(1310))
static_assert(is_iterator_traversal<Traversal>::value, "Traversal must be a traversal tag."); static_assert(is_iterator_traversal<Traversal>::value, "Traversal must be a traversal tag.");
# endif
}; };
// Computes an iterator_category tag whose traversal is Traversal and // Computes an iterator_category tag whose traversal is Traversal and

View File

@@ -1,19 +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 MINIMUM_CATEGORY_DWA20031119_HPP
# define MINIMUM_CATEGORY_DWA20031119_HPP
# include <boost/iterator/minimum_category.hpp>
namespace boost {
// This import below (as well as the whole header) is for backward compatibility
// with boost/token_iterator.hpp. It should be removed as soon as that header is fixed.
namespace detail {
using iterators::minimum_category;
} // namespace detail
} // namespace boost
#endif // MINIMUM_CATEGORY_DWA20031119_HPP

View File

@@ -11,9 +11,7 @@
#include <boost/iterator/iterator_adaptor.hpp> #include <boost/iterator/iterator_adaptor.hpp>
#include <boost/iterator/iterator_categories.hpp> #include <boost/iterator/iterator_categories.hpp>
#include <boost/core/use_default.hpp>
#include <boost/config.hpp>
#include <boost/config/workaround.hpp>
namespace boost { namespace boost {
namespace iterators { namespace iterators {
@@ -64,13 +62,9 @@ namespace iterators {
filter_iterator(Iterator x, Iterator end_ = Iterator()) filter_iterator(Iterator x, Iterator end_ = Iterator())
: super_t(static_cast<Iterator&&>(x)), m_predicate(), m_end(static_cast<Iterator&&>(end_)) : super_t(static_cast<Iterator&&>(x)), m_predicate(), m_end(static_cast<Iterator&&>(end_))
{ {
// Pro8 is a little too aggressive about instantiating the
// body of this function.
#if !BOOST_WORKAROUND(__MWERKS__, BOOST_TESTED_AT(0x3003))
// Don't allow use of this constructor if Predicate is a // Don't allow use of this constructor if Predicate is a
// function pointer type, since it will be 0. // function pointer type, since it will be 0.
static_assert(std::is_class<Predicate>::value, "Predicate must be a class."); static_assert(std::is_class<Predicate>::value, "Predicate must be a class.");
#endif
satisfy_predicate(); satisfy_predicate();
} }
@@ -120,7 +114,7 @@ namespace iterators {
inline filter_iterator<Predicate,Iterator> inline filter_iterator<Predicate,Iterator>
make_filter_iterator( make_filter_iterator(
typename std::enable_if< typename std::enable_if<
is_class<Predicate>::value std::is_class<Predicate>::value
, Iterator , Iterator
>::type x >::type x
, Iterator end = Iterator()) , Iterator end = Iterator())
@@ -135,6 +129,4 @@ using iterators::make_filter_iterator;
} // namespace boost } // namespace boost
#undef BOOST_ITERATOR_DETAIL_MOVE
#endif // BOOST_FILTER_ITERATOR_23022003THW_HPP #endif // BOOST_FILTER_ITERATOR_23022003THW_HPP

View File

@@ -21,14 +21,6 @@
#include <iterator> #include <iterator>
#include <type_traits> #include <type_traits>
#ifdef BOOST_MPL_CFG_NO_HAS_XXX
# include <boost/shared_ptr.hpp>
# include <boost/scoped_ptr.hpp>
# include <memory>
#endif
#include <boost/iterator/detail/config_def.hpp> // must be last #include
namespace boost { namespace boost {
namespace iterators { namespace iterators {
@@ -106,11 +98,7 @@ namespace iterators {
private: private:
typename super_t::reference dereference() const typename super_t::reference dereference() const
{ {
# if BOOST_WORKAROUND(BOOST_BORLANDC, < 0x5A0 )
return const_cast<super_t::reference>(**this->base());
# else
return **this->base(); return **this->base();
# endif
} }
}; };
@@ -135,6 +123,4 @@ using iterators::make_indirect_iterator;
} // namespace boost } // namespace boost
#include <boost/iterator/detail/config_undef.hpp>
#endif // BOOST_INDIRECT_ITERATOR_23022003THW_HPP #endif // BOOST_INDIRECT_ITERATOR_23022003THW_HPP

View File

@@ -7,10 +7,7 @@
#ifndef BOOST_INTEROPERABLE_23022003THW_HPP #ifndef BOOST_INTEROPERABLE_23022003THW_HPP
# define BOOST_INTEROPERABLE_23022003THW_HPP # define BOOST_INTEROPERABLE_23022003THW_HPP
# include <type_traits>
# include <boost/iterator/detail/type_traits/disjunction.hpp> # include <boost/iterator/detail/type_traits/disjunction.hpp>
# include <boost/iterator/detail/config_def.hpp> // must appear last
namespace boost { namespace boost {
namespace iterators { namespace iterators {
@@ -41,6 +38,4 @@ using iterators::is_interoperable;
} // namespace boost } // namespace boost
# include <boost/iterator/detail/config_undef.hpp>
#endif // BOOST_INTEROPERABLE_23022003THW_HPP #endif // BOOST_INTEROPERABLE_23022003THW_HPP

View File

@@ -12,16 +12,12 @@
#include <iterator> #include <iterator>
#include <type_traits> #include <type_traits>
// should be the last #includes
#include <boost/iterator/detail/config_def.hpp>
namespace boost { namespace boost {
namespace iterators { namespace iterators {
namespace detail namespace detail
{ {
#ifndef BOOST_NO_LVALUE_RETURN_DETECTION
// Calling lvalue_preserver( <expression>, 0 ) returns a reference // Calling lvalue_preserver( <expression>, 0 ) returns a reference
// to the expression's result if <expression> is an lvalue, or // to the expression's result if <expression> is an lvalue, or
// not_an_lvalue() otherwise. // not_an_lvalue() otherwise.
@@ -33,14 +29,6 @@ namespace detail
template <class U> template <class U>
not_an_lvalue lvalue_preserver(U const&, ...); not_an_lvalue lvalue_preserver(U const&, ...);
# define BOOST_LVALUE_PRESERVER(expr) detail::lvalue_preserver(expr,0)
#else // BOOST_NO_LVALUE_RETURN_DETECTION
# define BOOST_LVALUE_PRESERVER(expr) expr
#endif // BOOST_NO_LVALUE_RETURN_DETECTION
// Guts of is_lvalue_iterator. Value is the iterator's value_type // Guts of is_lvalue_iterator. Value is the iterator's value_type
// and the result is computed in the nested rebind template. // and the result is computed in the nested rebind template.
template <class Value> template <class Value>
@@ -66,7 +54,7 @@ namespace detail
, value = ( , value = (
sizeof( sizeof(
is_lvalue_iterator_impl<Value>::tester( is_lvalue_iterator_impl<Value>::tester(
BOOST_LVALUE_PRESERVER(*x), 0 detail::lvalue_preserver(*x,0), 0
) )
) == 1 ) == 1
) )
@@ -74,8 +62,6 @@ namespace detail
}; };
}; };
#undef BOOST_LVALUE_PRESERVER
// //
// void specializations to handle std input and output iterators // void specializations to handle std input and output iterators
// //
@@ -153,6 +139,4 @@ using iterators::is_non_const_lvalue_iterator;
} // namespace boost } // namespace boost
#include <boost/iterator/detail/config_undef.hpp>
#endif // IS_LVALUE_ITERATOR_DWA2003112_HPP #endif // IS_LVALUE_ITERATOR_DWA2003112_HPP

View File

@@ -11,9 +11,6 @@
#include <iterator> #include <iterator>
#include <type_traits> #include <type_traits>
// should be the last #include
#include <boost/iterator/detail/config_def.hpp>
namespace boost { namespace boost {
namespace iterators { namespace iterators {
@@ -29,19 +26,11 @@ namespace detail
static char (& tester(any_conversion_eater, ...) )[2]; static char (& tester(any_conversion_eater, ...) )[2];
template <class It> template <class It>
struct rebind struct rebind : std::is_convertible<
{ decltype(*std::declval<It&>())
static It& x; , typename std::add_lvalue_reference<Value>::type
>
BOOST_STATIC_CONSTANT( {};
bool
, value = (
sizeof(
is_readable_iterator_impl<Value>::tester(*x, 1)
) == 1
)
);
};
}; };
#undef BOOST_READABLE_PRESERVER #undef BOOST_READABLE_PRESERVER
@@ -108,6 +97,4 @@ using iterators::is_readable_iterator;
} // namespace boost } // namespace boost
#include <boost/iterator/detail/config_undef.hpp>
#endif // IS_READABLE_ITERATOR_DWA2003112_HPP #endif // IS_READABLE_ITERATOR_DWA2003112_HPP

View File

@@ -13,9 +13,10 @@
#include <boost/iterator/iterator_categories.hpp> #include <boost/iterator/iterator_categories.hpp>
#include <boost/iterator/iterator_facade.hpp> #include <boost/iterator/iterator_facade.hpp>
#include <boost/iterator/detail/config_def.hpp>
#include <boost/iterator/iterator_traits.hpp> #include <boost/iterator/iterator_traits.hpp>
#include <boost/iterator/detail/config_def.hpp>
namespace boost { namespace boost {
namespace iterators { namespace iterators {

View File

@@ -6,11 +6,6 @@
#ifndef BOOST_ITERATOR_CATEGORIES_HPP #ifndef BOOST_ITERATOR_CATEGORIES_HPP
# define BOOST_ITERATOR_CATEGORIES_HPP # define BOOST_ITERATOR_CATEGORIES_HPP
# include <boost/config.hpp>
# include <boost/iterator/detail/config_def.hpp>
# include <boost/detail/workaround.hpp>
# include <boost/mpl/eval_if.hpp> # include <boost/mpl/eval_if.hpp>
# include <boost/mpl/identity.hpp> # include <boost/mpl/identity.hpp>
# include <boost/mpl/placeholders.hpp> # include <boost/mpl/placeholders.hpp>
@@ -208,6 +203,4 @@ using iterators::pure_traversal_tag;
} // namespace boost } // namespace boost
#include <boost/iterator/detail/config_undef.hpp>
#endif // BOOST_ITERATOR_CATEGORIES_HPP #endif // BOOST_ITERATOR_CATEGORIES_HPP

View File

@@ -27,9 +27,6 @@
#include <type_traits> #include <type_traits>
#include <memory> #include <memory>
#include <boost/iterator/detail/type_traits/negation.hpp>
#include <boost/iterator/detail/config_def.hpp> // this goes last
namespace boost { namespace boost {
namespace iterators { namespace iterators {
@@ -115,23 +112,6 @@ namespace iterators {
, std::add_pointer<const value_type> , std::add_pointer<const value_type>
, std::add_pointer<value_type> , std::add_pointer<value_type>
>::type pointer; >::type pointer;
# if defined(BOOST_NO_TEMPLATE_PARTIAL_SPECIALIZATION) \
&& (BOOST_WORKAROUND(_STLPORT_VERSION, BOOST_TESTED_AT(0x452)) \
|| BOOST_WORKAROUND(BOOST_DINKUMWARE_STDLIB, BOOST_TESTED_AT(310))) \
|| BOOST_WORKAROUND(BOOST_RWSTD_VER, BOOST_TESTED_AT(0x20101)) \
|| BOOST_WORKAROUND(BOOST_DINKUMWARE_STDLIB, <= 310)
// To interoperate with some broken library/compiler
// combinations, user-defined iterators must be derived from
// std::iterator. It is possible to implement a standard
// library for broken compilers without this limitation.
# define BOOST_ITERATOR_FACADE_NEEDS_ITERATOR_BASE 1
typedef
iterator<iterator_category, value_type, Difference, pointer, Reference>
base;
# endif
}; };
// iterators whose dereference operators reference the same value // iterators whose dereference operators reference the same value
@@ -277,33 +257,6 @@ namespace iterators {
writable_postfix_increment_dereference_proxy<Iterator> dereference_proxy; writable_postfix_increment_dereference_proxy<Iterator> dereference_proxy;
}; };
# ifdef BOOST_NO_TEMPLATE_PARTIAL_SPECIALIZATION
template <class Reference, class Value>
struct is_non_proxy_reference_impl
{
static Reference r;
template <class R>
static typename std::conditional<
std::is_convertible<
R const volatile*
, Value const volatile*
>::value
, char[1]
, char[2]
>::type& helper(R const&);
BOOST_STATIC_CONSTANT(bool, value = sizeof(helper(r)) == 1);
};
template <class Reference, class Value>
struct is_non_proxy_reference
: std::integral_constant<
bool
, is_non_proxy_reference_impl<Reference, Value>::value
>
{};
# else
template <class Reference, class Value> template <class Reference, class Value>
struct is_non_proxy_reference struct is_non_proxy_reference
: std::is_convertible< : std::is_convertible<
@@ -312,7 +265,6 @@ namespace iterators {
, Value const volatile* , Value const volatile*
> >
{}; {};
# endif
// A metafunction to choose the result type of postfix ++ // A metafunction to choose the result type of postfix ++
// //
@@ -527,12 +479,6 @@ namespace iterators {
// //
class iterator_core_access class iterator_core_access
{ {
# if defined(BOOST_NO_MEMBER_TEMPLATE_FRIENDS)
// Tasteless as this may seem, making all members public allows member templates
// to work in the absence of member template friends.
public:
# else
template <class I, class V, class TC, class R, class D> friend class iterator_facade; template <class I, class V, class TC, class R, class D> friend class iterator_facade;
template <class I, class V, class TC, class R, class D, bool IsBidirectionalTraversal, bool IsRandomAccessTraversal> template <class I, class V, class TC, class R, class D, bool IsBidirectionalTraversal, bool IsRandomAccessTraversal>
friend class detail::iterator_facade_base; friend class detail::iterator_facade_base;
@@ -573,8 +519,6 @@ namespace iterators {
) )
; ;
# endif
template <class Facade> template <class Facade>
static typename Facade::reference dereference(Facade const& f) static typename Facade::reference dereference(Facade const& f)
{ {
@@ -655,12 +599,6 @@ namespace iterators {
, class Difference , class Difference
> >
class iterator_facade_base< Derived, Value, CategoryOrTraversal, Reference, Difference, false, false > class iterator_facade_base< Derived, Value, CategoryOrTraversal, Reference, Difference, false, false >
# ifdef BOOST_ITERATOR_FACADE_NEEDS_ITERATOR_BASE
: public boost::iterators::detail::iterator_facade_types<
Value, CategoryOrTraversal, Reference, Difference
>::base
# undef BOOST_ITERATOR_FACADE_NEEDS_ITERATOR_BASE
# endif
{ {
private: private:
typedef boost::iterators::detail::iterator_facade_types< typedef boost::iterators::detail::iterator_facade_types<
@@ -994,6 +932,4 @@ using iterators::iterator_facade;
} // namespace boost } // namespace boost
#include <boost/iterator/detail/config_undef.hpp>
#endif // BOOST_ITERATOR_FACADE_23022003THW_HPP #endif // BOOST_ITERATOR_FACADE_23022003THW_HPP

View File

@@ -32,14 +32,13 @@
#include <boost/iterator/is_lvalue_iterator.hpp> #include <boost/iterator/is_lvalue_iterator.hpp>
#include <boost/iterator/is_readable_iterator.hpp> #include <boost/iterator/is_readable_iterator.hpp>
#include <boost/pending/iterator_tests.hpp> #include <boost/pending/iterator_tests.hpp>
#include <iterator>
#include <type_traits>
#include <boost/core/lightweight_test.hpp> #include <boost/core/lightweight_test.hpp>
#include <boost/detail/is_incrementable.hpp> #include <boost/detail/is_incrementable.hpp>
#include <boost/iterator/detail/config_def.hpp>
#include <boost/iterator/detail/type_traits/conjunction.hpp> #include <boost/iterator/detail/type_traits/conjunction.hpp>
#include <iterator>
#include <type_traits>
namespace boost { namespace boost {
// Do separate tests for *i++ so we can treat, e.g., smart pointers, // Do separate tests for *i++ so we can treat, e.g., smart pointers,
@@ -81,7 +80,6 @@ void readable_iterator_test(const Iterator i1, T v)
BOOST_TEST(v1 == v); BOOST_TEST(v1 == v);
BOOST_TEST(v2 == v); BOOST_TEST(v2 == v);
#if !BOOST_WORKAROUND(__MWERKS__, <= 0x2407)
readable_iterator_traversal_test( readable_iterator_traversal_test(
i1, v, i1, v,
std::integral_constant< std::integral_constant<
@@ -91,7 +89,6 @@ void readable_iterator_test(const Iterator i1, T v)
// the above code. // the above code.
static_assert(is_readable_iterator<Iterator>::value, static_assert(is_readable_iterator<Iterator>::value,
"Iterator must be readable."); "Iterator must be readable.");
#endif
} }
template <class Iterator, class T> template <class Iterator, class T>
@@ -99,14 +96,12 @@ void writable_iterator_test(Iterator i, T v, T v2) {
Iterator i2(i); // Copy Constructible Iterator i2(i); // Copy Constructible
*i2 = v; *i2 = v;
#if !BOOST_WORKAROUND(__MWERKS__, <= 0x2407)
writable_iterator_traversal_test( writable_iterator_traversal_test(
i, v2, i, v2,
iterators::detail::conjunction< iterators::detail::conjunction<
std::integral_constant<bool, detail::is_incrementable<Iterator>::value>, std::integral_constant<bool, detail::is_incrementable<Iterator>::value>,
std::integral_constant<bool, detail::is_postfix_incrementable<Iterator>::value> std::integral_constant<bool, detail::is_postfix_incrementable<Iterator>::value>
>()); >());
#endif
} }
template <class Iterator> template <class Iterator>
@@ -153,12 +148,10 @@ void non_const_lvalue_iterator_test(Iterator i, T v1, T v2) {
T& v4 = *i2; T& v4 = *i2;
BOOST_TEST(v2 == v4); BOOST_TEST(v2 == v4);
#ifndef BOOST_NO_LVALUE_RETURN_DETECTION
static_assert(is_lvalue_iterator<Iterator>::value, static_assert(is_lvalue_iterator<Iterator>::value,
"Iterator must be an lvalue iterator."); "Iterator must be an lvalue iterator.");
static_assert(is_non_const_lvalue_iterator<Iterator>::value, static_assert(is_non_const_lvalue_iterator<Iterator>::value,
"Iterator must be non-const."); "Iterator must be non-const.");
#endif
} }
template <class Iterator, class T> template <class Iterator, class T>
@@ -265,6 +258,4 @@ void random_access_readable_iterator_test(Iterator i, int N, TrueVals vals)
} // namespace boost } // namespace boost
#include <boost/iterator/detail/config_undef.hpp>
#endif // BOOST_NEW_ITERATOR_TESTS_HPP #endif // BOOST_NEW_ITERATOR_TESTS_HPP

View File

@@ -16,8 +16,6 @@
#include <type_traits> #include <type_traits>
#include <iterator> #include <iterator>
#include <boost/iterator/detail/config_def.hpp>
namespace boost { namespace boost {
namespace iterators { namespace iterators {
@@ -100,9 +98,7 @@ namespace iterators {
transform_iterator( transform_iterator(
transform_iterator<OtherUnaryFunction, OtherIterator, OtherReference, OtherValue> const& t transform_iterator<OtherUnaryFunction, OtherIterator, OtherReference, OtherValue> const& t
, typename enable_if_convertible<OtherIterator, Iterator>::type* = 0 , typename enable_if_convertible<OtherIterator, Iterator>::type* = 0
#if !BOOST_WORKAROUND(BOOST_MSVC, == 1310)
, typename enable_if_convertible<OtherUnaryFunction, UnaryFunc>::type* = 0 , typename enable_if_convertible<OtherUnaryFunction, UnaryFunc>::type* = 0
#endif
) )
: super_t(t.base()), m_f(t.functor()) : super_t(t.base()), m_f(t.functor())
{} {}
@@ -142,16 +138,6 @@ namespace iterators {
{ {
return transform_iterator<UnaryFunc, Iterator>(it, UnaryFunc()); return transform_iterator<UnaryFunc, Iterator>(it, UnaryFunc());
} }
#if defined(BOOST_NO_TEMPLATE_PARTIAL_SPECIALIZATION) && !defined(BOOST_NO_FUNCTION_TEMPLATE_ORDERING)
template <class Return, class Argument, class Iterator>
inline transform_iterator< Return (*)(Argument), Iterator, Return>
make_transform_iterator(Iterator it, Return (*fun)(Argument))
{
return transform_iterator<Return (*)(Argument), Iterator, Return>(it, fun);
}
#endif
} // namespace iterators } // namespace iterators
using iterators::transform_iterator; using iterators::transform_iterator;
@@ -159,6 +145,4 @@ using iterators::make_transform_iterator;
} // namespace boost } // namespace boost
#include <boost/iterator/detail/config_undef.hpp>
#endif // BOOST_TRANSFORM_ITERATOR_23022003THW_HPP #endif // BOOST_TRANSFORM_ITERATOR_23022003THW_HPP

View File

@@ -12,17 +12,16 @@
#include <boost/iterator/iterator_facade.hpp> #include <boost/iterator/iterator_facade.hpp>
#include <boost/iterator/iterator_adaptor.hpp> // for enable_if_convertible #include <boost/iterator/iterator_adaptor.hpp> // for enable_if_convertible
#include <boost/iterator/iterator_categories.hpp> #include <boost/iterator/iterator_categories.hpp>
#include <boost/iterator/minimum_category.hpp> #include <boost/iterator/minimum_category.hpp>
#include <utility> // for std::pair #include <utility> // for std::pair
#include <boost/fusion/adapted/boost_tuple.hpp> // for backward compatibility
#include <boost/mpl/at.hpp> #include <boost/mpl/at.hpp>
#include <boost/mpl/fold.hpp> #include <boost/mpl/fold.hpp>
#include <boost/mpl/transform.hpp> #include <boost/mpl/transform.hpp>
#include <boost/mpl/placeholders.hpp> #include <boost/mpl/placeholders.hpp>
#include <boost/fusion/adapted/boost_tuple.hpp> // for backward compatibility
#include <boost/fusion/algorithm/iteration/for_each.hpp> #include <boost/fusion/algorithm/iteration/for_each.hpp>
#include <boost/fusion/algorithm/transformation/transform.hpp> #include <boost/fusion/algorithm/transformation/transform.hpp>
#include <boost/fusion/sequence/convert.hpp> #include <boost/fusion/sequence/convert.hpp>

View File

@@ -37,8 +37,7 @@
#if !defined(__SGI_STL_PORT) \ #if !defined(__SGI_STL_PORT) \
&& (defined(BOOST_MSVC_STD_ITERATOR) \ && (defined(BOOST_MSVC_STD_ITERATOR) \
|| BOOST_WORKAROUND(_CPPLIB_VER, <= 310) \ || BOOST_WORKAROUND(_CPPLIB_VER, <= 310))
|| BOOST_WORKAROUND(__GNUC__, <= 2))
// std container random-access iterators don't support mutable/const // std container random-access iterators don't support mutable/const
// interoperability (but may support const/mutable interop). // interoperability (but may support const/mutable interop).

View File

@@ -8,9 +8,6 @@
#include <boost/noncopyable.hpp> #include <boost/noncopyable.hpp>
#include <boost/iterator/is_lvalue_iterator.hpp> #include <boost/iterator/is_lvalue_iterator.hpp>
// Last, for BOOST_NO_LVALUE_RETURN_DETECTION
#include <boost/iterator/detail/config_def.hpp>
struct v struct v
{ {
v(); v();
@@ -104,10 +101,8 @@ int main()
"boost::is_lvalue_iterator<proxy_iterator<v>>::value is expected to be false."); "boost::is_lvalue_iterator<proxy_iterator<v>>::value is expected to be false.");
static_assert(!boost::is_lvalue_iterator<proxy_iterator<int>>::value, static_assert(!boost::is_lvalue_iterator<proxy_iterator<int>>::value,
"boost::is_lvalue_iterator<proxy_iterator<int>>::value is expected to be false."); "boost::is_lvalue_iterator<proxy_iterator<int>>::value is expected to be false.");
#ifndef BOOST_NO_LVALUE_RETURN_DETECTION
static_assert(!boost::is_lvalue_iterator<value_iterator>::value, static_assert(!boost::is_lvalue_iterator<value_iterator>::value,
"boost::is_lvalue_iterator<value_iterator>::value is expected to be false."); "boost::is_lvalue_iterator<value_iterator>::value is expected to be false.");
#endif
// Make sure inaccessible copy constructor doesn't prevent // Make sure inaccessible copy constructor doesn't prevent
// reference binding // reference binding
static_assert(boost::is_lvalue_iterator<noncopyable_iterator>::value, static_assert(boost::is_lvalue_iterator<noncopyable_iterator>::value,
@@ -150,19 +145,15 @@ int main()
"boost::is_non_const_lvalue_iterator<proxy_iterator<v>>::value is expected to be false."); "boost::is_non_const_lvalue_iterator<proxy_iterator<v>>::value is expected to be false.");
static_assert(!boost::is_non_const_lvalue_iterator<proxy_iterator<int>>::value, static_assert(!boost::is_non_const_lvalue_iterator<proxy_iterator<int>>::value,
"boost::is_non_const_lvalue_iterator<proxy_iterator<int>>::value is expected to be false."); "boost::is_non_const_lvalue_iterator<proxy_iterator<int>>::value is expected to be false.");
#ifndef BOOST_NO_LVALUE_RETURN_DETECTION
static_assert(!boost::is_non_const_lvalue_iterator<value_iterator>::value, static_assert(!boost::is_non_const_lvalue_iterator<value_iterator>::value,
"boost::is_non_const_lvalue_iterator<value_iterator>::value is expected to be false."); "boost::is_non_const_lvalue_iterator<value_iterator>::value is expected to be false.");
#endif
static_assert(!boost::is_non_const_lvalue_iterator<noncopyable_iterator>::value, static_assert(!boost::is_non_const_lvalue_iterator<noncopyable_iterator>::value,
"boost::is_non_const_lvalue_iterator<noncopyable_iterator>::value is expected to be false."); "boost::is_non_const_lvalue_iterator<noncopyable_iterator>::value is expected to be false.");
static_assert(boost::is_non_const_lvalue_iterator<lvalue_iterator<v>>::value, static_assert(boost::is_non_const_lvalue_iterator<lvalue_iterator<v>>::value,
"boost::is_non_const_lvalue_iterator<lvalue_iterator<v>>::value is expected to be true."); "boost::is_non_const_lvalue_iterator<lvalue_iterator<v>>::value is expected to be true.");
#if !BOOST_WORKAROUND(BOOST_BORLANDC, BOOST_TESTED_AT(0x564))
static_assert(boost::is_non_const_lvalue_iterator<lvalue_iterator<int>>::value, static_assert(boost::is_non_const_lvalue_iterator<lvalue_iterator<int>>::value,
"boost::is_non_const_lvalue_iterator<lvalue_iterator<int>>::value is expected to be true."); "boost::is_non_const_lvalue_iterator<lvalue_iterator<int>>::value is expected to be true.");
#endif
static_assert(boost::is_non_const_lvalue_iterator<lvalue_iterator<char*>>::value, static_assert(boost::is_non_const_lvalue_iterator<lvalue_iterator<char*>>::value,
"boost::is_non_const_lvalue_iterator<lvalue_iterator<char*>>::value is expected to be true."); "boost::is_non_const_lvalue_iterator<lvalue_iterator<char*>>::value is expected to be true.");
static_assert(boost::is_non_const_lvalue_iterator<lvalue_iterator<float>>::value, static_assert(boost::is_non_const_lvalue_iterator<lvalue_iterator<float>>::value,

View File

@@ -8,9 +8,6 @@
#include <boost/noncopyable.hpp> #include <boost/noncopyable.hpp>
#include <boost/iterator/is_readable_iterator.hpp> #include <boost/iterator/is_readable_iterator.hpp>
// Last, for BOOST_NO_LVALUE_RETURN_DETECTION
#include <boost/iterator/detail/config_def.hpp>
struct v struct v
{ {
v(); v();

View File

@@ -13,10 +13,8 @@
#include <numeric> #include <numeric>
#include <boost/iterator/iterator_adaptor.hpp> #include <boost/iterator/iterator_adaptor.hpp>
#if !BOOST_WORKAROUND(__MWERKS__, <= 0x2407)
#include <boost/iterator/is_readable_iterator.hpp> #include <boost/iterator/is_readable_iterator.hpp>
#include <boost/iterator/is_lvalue_iterator.hpp> #include <boost/iterator/is_lvalue_iterator.hpp>
#endif
#include <boost/pending/iterator_tests.hpp> #include <boost/pending/iterator_tests.hpp>
# include <boost/core/lightweight_test.hpp> # include <boost/core/lightweight_test.hpp>
@@ -29,8 +27,6 @@
#include "static_assert_same.hpp" #include "static_assert_same.hpp"
#include <boost/iterator/detail/config_def.hpp>
using boost::dummyT; using boost::dummyT;
typedef std::deque<int> storage; typedef std::deque<int> storage;
@@ -56,9 +52,6 @@ struct ptr_iterator
, V* , V*
, V , V
, boost::random_access_traversal_tag , boost::random_access_traversal_tag
#if BOOST_WORKAROUND(BOOST_BORLANDC, BOOST_TESTED_AT(0x551))
, V&
#endif
> >
{ {
private: private:
@@ -67,9 +60,6 @@ private:
, V* , V*
, V , V
, boost::random_access_traversal_tag , boost::random_access_traversal_tag
#if BOOST_WORKAROUND(BOOST_BORLANDC, BOOST_TESTED_AT(0x551))
, V&
#endif
> super_t; > super_t;
public: public:
@@ -208,12 +198,10 @@ main()
test = static_assert_same<Iter1::reference, int&>::value; test = static_assert_same<Iter1::reference, int&>::value;
test = static_assert_same<Iter1::pointer, int*>::value; test = static_assert_same<Iter1::pointer, int*>::value;
test = static_assert_same<Iter1::difference_type, std::ptrdiff_t>::value; test = static_assert_same<Iter1::difference_type, std::ptrdiff_t>::value;
#if !BOOST_WORKAROUND(__MWERKS__, <= 0x2407)
static_assert( static_assert(
std::is_convertible<Iter1::iterator_category, std::random_access_iterator_tag>::value, std::is_convertible<Iter1::iterator_category, std::random_access_iterator_tag>::value,
"Iterator must have a random access category." "Iterator must have a random access category."
); );
#endif
} }
{ {
@@ -222,16 +210,10 @@ main()
test = static_assert_same<Iter1::value_type, int>::value; test = static_assert_same<Iter1::value_type, int>::value;
test = static_assert_same<Iter1::reference, const int&>::value; test = static_assert_same<Iter1::reference, const int&>::value;
#if !BOOST_WORKAROUND(__MWERKS__, <= 0x2407)
static_assert(boost::is_readable_iterator<Iter1>::value, "Iter1 is expected to be readable."); static_assert(boost::is_readable_iterator<Iter1>::value, "Iter1 is expected to be readable.");
# ifndef BOOST_NO_LVALUE_RETURN_DETECTION
static_assert(boost::is_lvalue_iterator<Iter1>::value, "Iter1 is expected to be lvalue iterator."); static_assert(boost::is_lvalue_iterator<Iter1>::value, "Iter1 is expected to be lvalue iterator.");
# endif
#endif
#if !BOOST_WORKAROUND(BOOST_BORLANDC, BOOST_TESTED_AT(0x564)) // borland drops constness
test = static_assert_same<Iter1::pointer, int const*>::value; test = static_assert_same<Iter1::pointer, int const*>::value;
#endif
} }
{ {
@@ -241,11 +223,8 @@ main()
test = static_assert_same<Iter::value_type, int>::value; test = static_assert_same<Iter::value_type, int>::value;
test = static_assert_same<Iter::reference, int const&>::value; test = static_assert_same<Iter::reference, int const&>::value;
#if !BOOST_WORKAROUND(BOOST_BORLANDC, BOOST_TESTED_AT(0x564)) // borland drops constness
test = static_assert_same<Iter::pointer, int const*>::value; test = static_assert_same<Iter::pointer, int const*>::value;
#endif
#ifndef BOOST_NO_LVALUE_RETURN_DETECTION
static_assert( static_assert(
boost::is_non_const_lvalue_iterator<BaseIter>::value, boost::is_non_const_lvalue_iterator<BaseIter>::value,
"boost::is_non_const_lvalue_iterator<BaseIter>::value is expected to be true." "boost::is_non_const_lvalue_iterator<BaseIter>::value is expected to be true."
@@ -254,7 +233,6 @@ main()
boost::is_lvalue_iterator<Iter>::value, boost::is_lvalue_iterator<Iter>::value,
"boost::is_lvalue_iterator<Iter>::value is expected to be true." "boost::is_lvalue_iterator<Iter>::value is expected to be true."
); );
#endif
typedef modify_traversal<BaseIter, boost::incrementable_traversal_tag> IncrementableIter; typedef modify_traversal<BaseIter, boost::incrementable_traversal_tag> IncrementableIter;

View File

@@ -23,16 +23,6 @@
#include "static_assert_same.hpp" #include "static_assert_same.hpp"
#ifdef BOOST_NO_TEMPLATE_PARTIAL_SPECIALIZATION
namespace boost { namespace detail
{
template<> struct function_object_result<int (*)(int)>
{
typedef int type;
};
}}
#endif
struct mult_functor { struct mult_functor {
// Functors used with transform_iterator must be // Functors used with transform_iterator must be
// DefaultConstructible, as the transform_iterator must be // DefaultConstructible, as the transform_iterator must be