7 #ifndef BOOST_ITERATOR_FACADE_23022003THW_HPP 8 #define BOOST_ITERATOR_FACADE_23022003THW_HPP 55 template <
class T,
class U>
63 template<
typename CategoryOrTraversal,
typename Required >
65 public boost::is_convertible< typename iterator_category_to_traversal< CategoryOrTraversal >::type, Required >
78 is_interoperable< Facade1, Facade2 >
94 is_interoperable< Facade1, Facade2 >
95 , is_traversal_at_least< typename iterator_category< Facade1 >::type, random_access_traversal_tag >
96 , is_traversal_at_least< typename iterator_category< Facade2 >::type, random_access_traversal_tag >
108 ,
class CategoryOrTraversal
115 CategoryOrTraversal, ValueParam, Reference
127 # if defined(BOOST_NO_TEMPLATE_PARTIAL_SPECIALIZATION) \ 128 && (BOOST_WORKAROUND(_STLPORT_VERSION, BOOST_TESTED_AT(0x452)) \ 129 || BOOST_WORKAROUND(BOOST_DINKUMWARE_STDLIB, BOOST_TESTED_AT(310))) \ 130 || BOOST_WORKAROUND(BOOST_RWSTD_VER, BOOST_TESTED_AT(0x20101)) \ 131 || BOOST_WORKAROUND(BOOST_DINKUMWARE_STDLIB, <= 310) 137 # define BOOST_ITERATOR_FACADE_NEEDS_ITERATOR_BASE 1 140 iterator<iterator_category, value_type, Difference, pointer, Reference>
151 template <
class Iterator>
167 return this->stored_value;
177 template <
class Iterator>
198 operator value_type&()
const 207 *this->stored_iterator =
x;
215 *this->stored_iterator =
x;
220 operator Iterator
const&()
const 222 return stored_iterator;
230 # ifdef BOOST_NO_TEMPLATE_PARTIAL_SPECIALIZATION 232 template <
class Reference,
class Value>
233 struct is_non_proxy_reference_impl
241 ,
Value const volatile*
250 template <
class Reference,
class Value>
253 is_non_proxy_reference_impl<Reference, Value>::value
257 template <
class Reference,
class Value>
260 typename remove_reference<Reference>::type
262 , Value const volatile*
282 template <
class Iterator,
class Value,
class Reference,
class CategoryOrTraversal>
287 is_convertible<Reference,Value const&>
293 typename iterator_category_to_traversal<CategoryOrTraversal>::type
294 , forward_traversal_tag
299 is_non_proxy_reference<Reference,Value>
300 , postfix_increment_proxy<Iterator>
301 , writable_postfix_increment_proxy<Iterator>
303 , mpl::identity<Iterator>
311 template <
class Reference,
class Po
inter>
316 explicit proxy(Reference
const &
x) : m_ref(x) {}
324 static result_type
apply(Reference
const &
x)
326 return result_type(x);
330 template <
class T,
class Po
inter>
343 template <
class Iterator>
373 template <
class ValueType,
class Reference>
379 boost::is_POD<ValueType>
380 , iterator_writability_disabled<ValueType,Reference>
385 template <
class Iterator,
class Value,
class Reference>
395 template <
class Iterator>
401 template <
class Iterator>
409 template <
class I1,
class I2>
412 # ifdef BOOST_NO_ONE_WAY_ITERATOR_INTEROP 416 is_convertible<I2,I1>
417 , iterator_difference<I1>
418 , iterator_difference<I2>
428 ,
class CategoryOrTraversal
431 ,
bool IsBidirectionalTraversal
432 ,
bool IsRandomAccessTraversal
440 # ifdef BOOST_NO_STRICT_ITERATOR_INTEROPERABILITY 441 # define BOOST_ITERATOR_FACADE_INTEROP_HEAD_IMPL(prefix, op, result_type, enabler) \ 443 class Derived1, class V1, class TC1, class Reference1, class Difference1 \ 444 , class Derived2, class V2, class TC2, class Reference2, class Difference2 \ 446 prefix typename mpl::apply2<result_type,Derived1,Derived2>::type \ 448 iterator_facade<Derived1, V1, TC1, Reference1, Difference1> const& lhs \ 449 , iterator_facade<Derived2, V2, TC2, Reference2, Difference2> const& rhs) 451 # define BOOST_ITERATOR_FACADE_INTEROP_HEAD_IMPL(prefix, op, result_type, enabler) \ 453 class Derived1, class V1, class TC1, class Reference1, class Difference1 \ 454 , class Derived2, class V2, class TC2, class Reference2, class Difference2 \ 456 prefix typename enabler< \ 458 , typename mpl::apply2<result_type,Derived1,Derived2>::type \ 461 iterator_facade<Derived1, V1, TC1, Reference1, Difference1> const& lhs \ 462 , iterator_facade<Derived2, V2, TC2, Reference2, Difference2> const& rhs) 465 # define BOOST_ITERATOR_FACADE_INTEROP_HEAD(prefix, op, result_type) \ 466 BOOST_ITERATOR_FACADE_INTEROP_HEAD_IMPL(prefix, op, result_type, boost::iterators::detail::enable_if_interoperable) 468 # define BOOST_ITERATOR_FACADE_INTEROP_RANDOM_ACCESS_HEAD(prefix, op, result_type) \ 469 BOOST_ITERATOR_FACADE_INTEROP_HEAD_IMPL(prefix, op, result_type, boost::iterators::detail::enable_if_interoperable_and_random_access_traversal) 471 # define BOOST_ITERATOR_FACADE_PLUS_HEAD(prefix,args) \ 472 template <class Derived, class V, class TC, class R, class D> \ 473 prefix typename boost::iterators::enable_if< \ 474 boost::iterators::detail::is_traversal_at_least< TC, boost::iterators::random_access_traversal_tag >, \ 476 >::type operator+ args 489 # if defined(BOOST_NO_MEMBER_TEMPLATE_FRIENDS) 496 template <
class I,
class V,
class TC,
class R,
class D,
bool IsB
idirectionalTraversal,
bool IsRandomAccessTraversal>
499 # define BOOST_ITERATOR_FACADE_RELATION(op) \ 500 BOOST_ITERATOR_FACADE_INTEROP_HEAD(friend,op, boost::iterators::detail::always_bool2); 505 # undef BOOST_ITERATOR_FACADE_RELATION 507 # define BOOST_ITERATOR_FACADE_RANDOM_ACCESS_RELATION(op) \ 508 BOOST_ITERATOR_FACADE_INTEROP_RANDOM_ACCESS_HEAD(friend,op, boost::iterators::detail::always_bool2); 515 # undef BOOST_ITERATOR_FACADE_RANDOM_ACCESS_RELATION 524 ,
typename Derived::difference_type)
530 , (
typename Derived::difference_type
537 template <
class Facade>
540 return f.dereference();
543 template <
class Facade>
549 template <
class Facade>
555 template <
class Facade1,
class Facade2>
561 template <
class Facade1,
class Facade2>
567 template <
class Facade>
568 static void advance(Facade&
f,
typename Facade::difference_type
n)
573 template <
class Facade1,
class Facade2>
575 Facade1
const& f1, Facade2
const& f2,
mpl::true_)
577 return -f1.distance_to(f2);
580 template <
class Facade1,
class Facade2>
584 return f2.distance_to(f1);
590 template <
class I,
class V,
class TC,
class R,
class D>
593 return *
static_cast<I*
>(&facade);
596 template <
class I,
class V,
class TC,
class R,
class D>
599 return *
static_cast<I const*
>(&facade);
612 ,
class CategoryOrTraversal
617 # ifdef BOOST_ITERATOR_FACADE_NEEDS_ITERATOR_BASE
619 Value, CategoryOrTraversal, Reference, Difference
621 # undef BOOST_ITERATOR_FACADE_NEEDS_ITERATOR_BASE 626 Value, CategoryOrTraversal, Reference, Difference
651 return operator_arrow_dispatch_::apply(*this->derived());
657 return this->derived();
666 return *
static_cast<Derived*
>(
this);
671 return *
static_cast<Derived const*
>(
this);
679 ,
class CategoryOrTraversal
684 public iterator_facade_base< Derived, Value, CategoryOrTraversal, Reference, Difference, false, false >
690 return this->derived();
695 Derived
tmp(this->derived());
705 ,
class CategoryOrTraversal
710 public iterator_facade_base< Derived, Value, CategoryOrTraversal, Reference, Difference, true, false >
725 return boost::iterators::detail::make_operator_brackets_result<Derived>(
734 return this->derived();
740 return this->derived();
745 Derived
result(this->derived());
759 ,
class CategoryOrTraversal
760 ,
class Reference = Value&
761 ,
class Difference = std::ptrdiff_t
770 detail::is_traversal_at_least< CategoryOrTraversal, bidirectional_traversal_tag >::value,
771 detail::is_traversal_at_least< CategoryOrTraversal, random_access_traversal_tag >::value
779 template <
class I,
class V,
class TC,
class R,
class D>
787 tmp(*static_cast<I*>(&i));
862 # ifdef BOOST_NO_ONE_WAY_ITERATOR_INTEROP 863 # define BOOST_ITERATOR_CONVERTIBLE(a,b) mpl::true_() 865 # define BOOST_ITERATOR_CONVERTIBLE(a,b) is_convertible<a,b>() 868 # define BOOST_ITERATOR_FACADE_INTEROP(op, result_type, return_prefix, base_op) \ 869 BOOST_ITERATOR_FACADE_INTEROP_HEAD(inline, op, result_type) \ 872 BOOST_STATIC_ASSERT(( \ 873 is_interoperable< Derived1, Derived2 >::value \ 875 return_prefix iterator_core_access::base_op( \ 876 *static_cast<Derived1 const*>(&lhs) \ 877 , *static_cast<Derived2 const*>(&rhs) \ 878 , BOOST_ITERATOR_CONVERTIBLE(Derived2,Derived1) \ 882 # define BOOST_ITERATOR_FACADE_RELATION(op, return_prefix, base_op) \ 883 BOOST_ITERATOR_FACADE_INTEROP( \ 885 , boost::iterators::detail::always_bool2 \ 893 # undef BOOST_ITERATOR_FACADE_RELATION 896 # define BOOST_ITERATOR_FACADE_INTEROP_RANDOM_ACCESS(op, result_type, return_prefix, base_op) \ 897 BOOST_ITERATOR_FACADE_INTEROP_RANDOM_ACCESS_HEAD(inline, op, result_type) \ 900 BOOST_STATIC_ASSERT(( \ 901 is_interoperable< Derived1, Derived2 >::value && \ 902 boost::iterators::detail::is_traversal_at_least< typename iterator_category< Derived1 >::type, random_access_traversal_tag >::value && \ 903 boost::iterators::detail::is_traversal_at_least< typename iterator_category< Derived2 >::type, random_access_traversal_tag >::value \ 905 return_prefix iterator_core_access::base_op( \ 906 *static_cast<Derived1 const*>(&lhs) \ 907 , *static_cast<Derived2 const*>(&rhs) \ 908 , BOOST_ITERATOR_CONVERTIBLE(Derived2,Derived1) \ 912 # define BOOST_ITERATOR_FACADE_RANDOM_ACCESS_RELATION(op, return_prefix, base_op) \ 913 BOOST_ITERATOR_FACADE_INTEROP_RANDOM_ACCESS( \ 915 , boost::iterators::detail::always_bool2 \ 922 BOOST_ITERATOR_FACADE_RANDOM_ACCESS_RELATION(<=, return 0 >=, distance_from)
923 BOOST_ITERATOR_FACADE_RANDOM_ACCESS_RELATION(>=, return 0 <=, distance_from)
925 # undef BOOST_ITERATOR_FACADE_RANDOM_ACCESS_RELATION 935 # undef BOOST_ITERATOR_FACADE_INTEROP 936 # undef BOOST_ITERATOR_FACADE_INTEROP_RANDOM_ACCESS 938 # define BOOST_ITERATOR_FACADE_PLUS(args) \ 939 BOOST_ITERATOR_FACADE_PLUS_HEAD(inline, args) \ 941 Derived tmp(static_cast<Derived const&>(i)); \ 947 ,
typename Derived::difference_type
n 951 typename Derived::difference_type
n 955 # undef BOOST_ITERATOR_FACADE_PLUS 956 # undef BOOST_ITERATOR_FACADE_PLUS_HEAD 958 # undef BOOST_ITERATOR_FACADE_INTEROP_HEAD 959 # undef BOOST_ITERATOR_FACADE_INTEROP_RANDOM_ACCESS_HEAD 960 # undef BOOST_ITERATOR_FACADE_INTEROP_HEAD_IMPL 971 #endif // BOOST_ITERATOR_FACADE_23022003THW_HPP #define BOOST_ITERATOR_FACADE_INTEROP_RANDOM_ACCESS_HEAD(prefix, op, result_type)
BOOST_FORCEINLINE T * addressof(T &v)
static I & derived(iterator_facade< I, V, TC, R, D > &facade)
iterator_value< Iterator >::type value_type
Derived const & derived() const
static void advance(Facade &f, typename Facade::difference_type n)
#define BOOST_DELETED_FUNCTION(fun)
BOOST_MOVE_USE_STANDARD_LIBRARY_MOVE.
associated_types::iterator_category iterator_category
static void increment(Facade &f)
boost::iterators::detail::iterator_facade_types< Value, CategoryOrTraversal, Reference, Difference > associated_types
mpl::eval_if< boost::iterators::detail::iterator_writability_disabled< ValueParam, Reference >, add_pointer< const value_type >, add_pointer< value_type > >::type pointer
static I const & derived(iterator_facade< I, V, TC, R, D > const &facade)
static bool equal(Facade1 const &f1, Facade2 const &f2, mpl::false_)
writable_postfix_increment_proxy const & operator*() const
operator_arrow_dispatch_::result_type pointer
static bool equal(Facade1 const &f1, Facade2 const &f2, mpl::true_)
Derived operator-(difference_type x) const
writable_postfix_increment_proxy(Iterator const &x)
Derived & operator+=(difference_type n)
pointer operator->() const
Derived & operator-=(difference_type n)
boost::iterators::detail::operator_brackets_result< Derived, Value, reference >::type operator[](difference_type n) const
facade_iterator_category< CategoryOrTraversal, ValueParam, Reference >::type iterator_category
boost::detail::iterator_traits< Iterator >::value_type type
static void decrement(Facade &f)
base_type::difference_type difference_type
operator_brackets_proxy & operator=(value_type const &val)
Iterator::reference reference
base_type::reference reference
#define BOOST_ITERATOR_FACADE_PLUS_HEAD(prefix, args)
#define BOOST_ITERATOR_FACADE_PLUS(args)
#define BOOST_ITERATOR_FACADE_RANDOM_ACCESS_RELATION(op)
T const & operator=(T const &x) const
value_type & operator*() const
iterator_facade< Derived, Value, CategoryOrTraversal, Reference, Difference > iterator_facade_
mpl::if_< use_operator_brackets_proxy< Value, Reference >, operator_brackets_proxy< Iterator >, Value >::type type
Difference difference_type
IMGUI_API void Value(const char *prefix, bool b)
BOOST_ITERATOR_FACADE_INTEROP_RANDOM_ACCESS(-, boost::iterators::detail::choose_difference_type, return, distance_from) BOOST_ITERATOR_FACADE_PLUS((iterator_facade< Derived
static Facade2::difference_type distance_from(Facade1 const &f1, Facade2 const &f2, mpl::false_)
remove_const< ValueParam >::type value_type
operator_brackets_proxy< Iterator > make_operator_brackets_result(Iterator const &iter, mpl::true_)
iterator_value< Iterator >::type value_type
boost::iterators::detail::operator_arrow_dispatch< Reference, typename associated_types::pointer > operator_arrow_dispatch_
Iterator::value_type value_type
static result_type apply(T &x)
T & operator=(T &x) const
proxy(Reference const &x)
static Facade1::difference_type distance_from(Facade1 const &f1, Facade2 const &f2, mpl::true_)
static result_type apply(Reference const &x)
#define BOOST_ITERATOR_FACADE_RELATION(op)
postfix_increment_proxy(Iterator const &x)
operator_brackets_proxy(Iterator const &iter)
associated_types::value_type value_type
static Facade::reference dereference(Facade const &f)
#define BOOST_STATIC_CONSTANT(type, assignment)
reference operator*() const
iterator_facade_base< Derived, Value, CategoryOrTraversal, Reference, Difference, true, false > base_type
boost::iterators::detail::postfix_increment_result< I, V, R, TC >::type operator++(iterator_facade< I, V, TC, R, D > &i, int)