// iterator_category deduction for iterator_facade
//
+namespace boost {
+namespace iterators {
+
// forward declaration
-namespace boost { struct use_default; }
+struct use_default;
-namespace boost { namespace detail {
+namespace detail {
struct input_output_iterator_tag
: std::input_iterator_tag
, boost::detail::indirect_traits::is_reference_to_const<Reference>
, is_const<ValueParam>
>
-# else
+# else
: is_const<ValueParam>
-# endif
+# endif
{};
// Convert an iterator_facade's traversal category, Value parameter,
// and ::reference type to an appropriate old-style category.
//
-// If writability has been disabled per the above metafunction, the
-// result will not be convertible to output_iterator_tag.
-//
-// Otherwise, if Traversal == single_pass_traversal_tag, the following
-// conditions will result in a tag that is convertible both to
-// input_iterator_tag and output_iterator_tag:
-//
-// 1. Reference is a reference to non-const
-// 2. Reference is not a reference and is convertible to Value
+// Due to changeset 21683, this now never results in a category convertible
+// to output_iterator_tag.
//
+// Change at: https://svn.boost.org/trac/boost/changeset/21683
template <class Traversal, class ValueParam, class Reference>
struct iterator_facade_default_category
: mpl::eval_if<
, typename mpl::eval_if<
mpl::and_<
is_convertible<Traversal, single_pass_traversal_tag>
-
+
// check for readability
, is_convertible<Reference, ValueParam>
>
struct iterator_category_with_traversal
: Category, Traversal
{
-# if !BOOST_WORKAROUND(BOOST_MSVC, <= 1300)
// Make sure this isn't used to build any categories where
// convertibility to Traversal is redundant. Should just use the
// Category element in that case.
BOOST_MPL_ASSERT_NOT((is_iterator_traversal<Category>));
# if !BOOST_WORKAROUND(BOOST_MSVC, BOOST_TESTED_AT(1310))
BOOST_MPL_ASSERT((is_iterator_traversal<Traversal>));
-# endif
-# endif
+# endif
};
// Computes an iterator_category tag whose traversal is Traversal and
template <class Traversal, class ValueParam, class Reference>
struct facade_iterator_category_impl
{
-# if !BOOST_WORKAROUND(BOOST_MSVC, <= 1300)
BOOST_MPL_ASSERT_NOT((is_iterator_category<Traversal>));
-# endif
-
+
typedef typename iterator_facade_default_category<
Traversal,ValueParam,Reference
>::type category;
-
+
typedef typename mpl::if_<
is_same<
Traversal
{
};
-}} // namespace boost::detail
+}}} // namespace boost::iterators::detail
# include <boost/iterator/detail/config_undef.hpp>