Boost logo

Boost-Commit :

From: chochlik_at_[hidden]
Date: 2008-05-10 06:38:31


Author: matus.chochlik
Date: 2008-05-10 06:38:28 EDT (Sat, 10 May 2008)
New Revision: 45258
URL: http://svn.boost.org/trac/boost/changeset/45258

Log:
Major Update:
Added meta-object sequence iterator and reverse iterator.hpp
Added begin, end, find_if, rbegin, rend, reverse_find_if.hpp
Added iterator comparisons
Tested with MSVC++ 2008 EE

Added:
   sandbox/mirror/boost/mirror/algorithm/detail/iterator_comparison.hpp (contents, props changed)
   sandbox/mirror/boost/mirror/algorithm/detail/positional.hpp (contents, props changed)
   sandbox/mirror/boost/mirror/algorithm/detail/rbegin.hpp (contents, props changed)
   sandbox/mirror/boost/mirror/algorithm/detail/rend.hpp (contents, props changed)
   sandbox/mirror/boost/mirror/algorithm/detail/reverse_find_if.hpp (contents, props changed)
   sandbox/mirror/boost/mirror/algorithm/detail/reverse_iterator.hpp (contents, props changed)
   sandbox/mirror/boost/mirror/algorithm/iterator_comparison.hpp (contents, props changed)
   sandbox/mirror/boost/mirror/algorithm/iterator_equal.hpp (contents, props changed)
   sandbox/mirror/boost/mirror/algorithm/iterator_greater.hpp (contents, props changed)
   sandbox/mirror/boost/mirror/algorithm/iterator_greater_equal.hpp (contents, props changed)
   sandbox/mirror/boost/mirror/algorithm/iterator_less.hpp (contents, props changed)
   sandbox/mirror/boost/mirror/algorithm/iterator_less_equal.hpp (contents, props changed)
   sandbox/mirror/boost/mirror/algorithm/iterator_not_equal.hpp (contents, props changed)
   sandbox/mirror/boost/mirror/algorithm/rbegin.hpp (contents, props changed)
   sandbox/mirror/boost/mirror/algorithm/rend.hpp (contents, props changed)
   sandbox/mirror/boost/mirror/algorithm/reverse_find_if.hpp (contents, props changed)
Removed:
   sandbox/mirror/boost/mirror/algorithm/is_equal_iterator.hpp
Text files modified:
   sandbox/mirror/boost/mirror/algorithm/begin.hpp | 38 +---------
   sandbox/mirror/boost/mirror/algorithm/detail/begin.hpp | 7 +
   sandbox/mirror/boost/mirror/algorithm/detail/common_iterator.hpp | 101 +++++++++++++++++++++++++---
   sandbox/mirror/boost/mirror/algorithm/detail/end.hpp | 7 +
   sandbox/mirror/boost/mirror/algorithm/detail/find_if.hpp | 1
   sandbox/mirror/boost/mirror/algorithm/detail/iterator.hpp | 27 +-----
   sandbox/mirror/boost/mirror/algorithm/end.hpp | 38 +---------
   sandbox/mirror/boost/mirror/algorithm/find_if.hpp | 41 +----------
   sandbox/mirror/boost/mirror/algorithms.hpp | 7 +
   sandbox/mirror/libs/mirror/doc/xml/mirror/_library.xml | 4 +
   sandbox/mirror/libs/mirror/example/algorithms/begin_end.cpp | 141 +++++++++++++++++++++++++++++++++++----
   11 files changed, 252 insertions(+), 160 deletions(-)

Modified: sandbox/mirror/boost/mirror/algorithm/begin.hpp
==============================================================================
--- sandbox/mirror/boost/mirror/algorithm/begin.hpp (original)
+++ sandbox/mirror/boost/mirror/algorithm/begin.hpp 2008-05-10 06:38:28 EDT (Sat, 10 May 2008)
@@ -12,46 +12,16 @@
 #define BOOST_MIRROR_ALGORITHM_BEGIN_HPP
 
 #include <boost/mirror/algorithm/detail/begin.hpp>
+#include <boost/mirror/algorithm/detail/positional.hpp>
 
 namespace boost {
 namespace mirror {
 namespace detail {
 
- /** Declaration of the default begin_impl
- * helper template.
- */
         template <class MetaObjectSequence>
- struct begin_impl { };
-
- /** Specialization of begin_impl<MetaObjectSequence>
- * for meta_class_attributes<>
- */
- template <class Class, class VariantTag>
- struct begin_impl<meta_class_attributes<Class, VariantTag> >
- : meta_object_sequence_begin<
- Class, VariantTag,
- meta_class_attributes<Class, VariantTag>
- >{ };
-
- /** Specialization of for_each_impl<MetaObjectSequence>
- * for meta_class_all_attributes<>
- */
- template <class Class, class VariantTag>
- struct begin_impl<meta_class_all_attributes<Class, VariantTag> >
- : meta_object_sequence_begin<
- Class, VariantTag,
- meta_class_all_attributes<Class, VariantTag>
- >{ };
-
- /** Specialization of for_each_impl<MetaObjectSequence>
- * for meta_base_classes<>
- */
- template <class Class, class VariantTag>
- struct begin_impl<meta_base_classes<Class, VariantTag> >
- : meta_object_sequence_begin<
- Class, VariantTag,
- meta_base_classes<Class, VariantTag>
- >{ };
+ struct begin_impl
+ : position_getter_impl<MetaObjectSequence, meta_object_sequence_begin>
+ { };
 
 } // namespace detail
 

Modified: sandbox/mirror/boost/mirror/algorithm/detail/begin.hpp
==============================================================================
--- sandbox/mirror/boost/mirror/algorithm/detail/begin.hpp (original)
+++ sandbox/mirror/boost/mirror/algorithm/detail/begin.hpp 2008-05-10 06:38:28 EDT (Sat, 10 May 2008)
@@ -21,17 +21,18 @@
         template <
                 class ReflectedType,
                 class VariantTag,
- class MetaObjectSequence
+ class MetaObjectSequence,
+ class Dummy
>
         struct meta_object_sequence_begin
         {
- typedef meta_object_iterator<
+ typedef typename get_meta_object_iterator<
                         ReflectedType,
                         VariantTag,
                         MetaObjectSequence,
                         mpl::int_<0>,
                         mpl::always<mpl::true_>
- > type;
+ >::type type;
         };
 
 } // namespace detail

Modified: sandbox/mirror/boost/mirror/algorithm/detail/common_iterator.hpp
==============================================================================
--- sandbox/mirror/boost/mirror/algorithm/detail/common_iterator.hpp (original)
+++ sandbox/mirror/boost/mirror/algorithm/detail/common_iterator.hpp 2008-05-10 06:38:28 EDT (Sat, 10 May 2008)
@@ -14,6 +14,7 @@
 #include <boost/mirror/algorithm/size.hpp>
 #include <boost/mirror/algorithm/at.hpp>
 #include <boost/mpl/int.hpp>
+#include <boost/mpl/arithmetic.hpp>
 #include <boost/mpl/if.hpp>
 #include <boost/mpl/apply.hpp>
 #include <boost/mpl/equal_to.hpp>
@@ -34,21 +35,29 @@
 
 namespace detail {
 
+ /** Forward declaration of iterator_pointee_selector
+ */
         template <class MetaObjectSequence>
         struct iterator_pointee_selector;
 
+ /** Basic template for the meta-object
+ * iterators
+ */
         template <
                 class ReflectedType,
                 class VariantTag,
                 class MetaObjectSequence,
                 class Position,
+ class BeginPos,
+ class EndPos,
+ class Direction,
                 class UnaryPredicate,
                 class Selector
-
>
- struct meta_object_iterator_base
+ struct meta_object_iterator_base_templ
         {
                 typedef Position position;
+ typedef Direction direction;
 
                 // the type meta_class_attribute
                 // that this iterator points to
@@ -67,11 +76,14 @@
                         template <typename DummyPosition>
                         struct apply
                         {
- typedef meta_object_iterator_base<
+ typedef meta_object_iterator_base_templ<
                                         ReflectedType,
                                         VariantTag,
                                         MetaObjectSequence,
                                         DummyPosition,
+ BeginPos,
+ EndPos,
+ Direction,
                                         UnaryPredicate,
                                         Selector
> type;
@@ -84,11 +96,20 @@
                         template <typename DummyPosition>
                         struct apply
                         {
- typedef meta_object_iterator_base<
+ typedef meta_object_iterator_base_templ<
                                         ReflectedType,
                                         VariantTag,
                                         MetaObjectSequence,
- mpl::int_<DummyPosition::value - 1>,
+ typename mpl::int_<mpl::minus<
+ DummyPosition,
+ mpl::times<
+ Direction,
+ mpl::int_<1>
+ >
+ >::value>,
+ BeginPos,
+ EndPos,
+ Direction,
                                         UnaryPredicate,
                                         Selector
> type;
@@ -100,16 +121,24 @@
                 template <int I>
                 struct get_initial_or_next_iterator
                 {
- typedef mpl::int_<size<MetaObjectSequence>::value > end_pos;
 
                         template <typename DummyPosition>
                         struct apply
                         {
- typedef meta_object_iterator_base<
+ typedef meta_object_iterator_base_templ<
                                         ReflectedType,
                                         VariantTag,
                                         MetaObjectSequence,
- mpl::int_<DummyPosition::value + I>,
+ typename mpl::int_<mpl::plus<
+ DummyPosition,
+ mpl::times<
+ Direction,
+ mpl::int_<I>
+ >
+ >::value>,
+ BeginPos,
+ EndPos,
+ Direction,
                                         UnaryPredicate,
                                         Selector
> next_iterator;
@@ -119,7 +148,7 @@
                                         typename deref<next_iterator>::type
>::type next_is_valid;
 
- // TODO: this needs to be optimized.
+ // TODO: this should be optimized.
                                 typedef typename mpl::if_<
                                         next_is_valid,
                                         next_iterator,
@@ -131,13 +160,16 @@
                         };
 
                         template <>
- struct apply<end_pos>
+ struct apply<EndPos>
                         {
- typedef meta_object_iterator_base<
+ typedef meta_object_iterator_base_templ<
                                         ReflectedType,
                                         VariantTag,
                                         MetaObjectSequence,
- end_pos,
+ EndPos,
+ BeginPos,
+ EndPos,
+ Direction,
                                         UnaryPredicate,
                                         Selector
> type;
@@ -149,6 +181,51 @@
 
         }; // meta_object_iterator_base
 
+ /** Forward iterator base template
+ */
+ template <
+ class ReflectedType,
+ class VariantTag,
+ class MetaObjectSequence,
+ class Position,
+ class UnaryPredicate,
+ class Selector
+ >
+ struct meta_object_iterator_base
+ : meta_object_iterator_base_templ<
+ ReflectedType,
+ VariantTag,
+ MetaObjectSequence,
+ Position,
+ mpl::int_<0>,
+ mpl::int_<size<MetaObjectSequence>::value >,
+ mpl::int_<1>,
+ UnaryPredicate,
+ Selector
+ >{ };
+
+ /** Reverse iterator base class
+ */
+ template <
+ class ReflectedType,
+ class VariantTag,
+ class MetaObjectSequence,
+ class Position,
+ class UnaryPredicate,
+ class Selector
+ >
+ struct meta_object_reverse_iterator_base
+ : meta_object_iterator_base_templ<
+ ReflectedType,
+ VariantTag,
+ MetaObjectSequence,
+ Position,
+ mpl::int_<size<MetaObjectSequence>::value -1 >,
+ mpl::int_<-1>,
+ mpl::int_<-1>,
+ UnaryPredicate,
+ Selector
+ >{ };
 
 
 } // namespace detail

Modified: sandbox/mirror/boost/mirror/algorithm/detail/end.hpp
==============================================================================
--- sandbox/mirror/boost/mirror/algorithm/detail/end.hpp (original)
+++ sandbox/mirror/boost/mirror/algorithm/detail/end.hpp 2008-05-10 06:38:28 EDT (Sat, 10 May 2008)
@@ -21,17 +21,18 @@
         template <
                 class ReflectedType,
                 class VariantTag,
- class MetaObjectSequence
+ class MetaObjectSequence,
+ class Dummy
>
         struct meta_object_sequence_end
         {
- typedef meta_object_iterator<
+ typedef typename get_meta_object_iterator<
                         ReflectedType,
                         VariantTag,
                         MetaObjectSequence,
                         mpl::int_<size<MetaObjectSequence>::value>,
                         mpl::always<mpl::true_>
- > type;
+ >::type type;
         };
 
 

Modified: sandbox/mirror/boost/mirror/algorithm/detail/find_if.hpp
==============================================================================
--- sandbox/mirror/boost/mirror/algorithm/detail/find_if.hpp (original)
+++ sandbox/mirror/boost/mirror/algorithm/detail/find_if.hpp 2008-05-10 06:38:28 EDT (Sat, 10 May 2008)
@@ -30,6 +30,7 @@
                         ReflectedType,
                         VariantTag,
                         MetaObjectSequence,
+ mpl::int_<0>,
                         Predicate
>::type type;
         };

Modified: sandbox/mirror/boost/mirror/algorithm/detail/iterator.hpp
==============================================================================
--- sandbox/mirror/boost/mirror/algorithm/detail/iterator.hpp (original)
+++ sandbox/mirror/boost/mirror/algorithm/detail/iterator.hpp 2008-05-10 06:38:28 EDT (Sat, 10 May 2008)
@@ -17,23 +17,6 @@
 namespace mirror {
 namespace detail {
 
- template <
- class ReflectedType,
- class VariantTag,
- class MetaObjectSequence,
- class Position,
- class UnaryPredicate
- >
- struct meta_object_iterator
- : meta_object_iterator_base<
- ReflectedType,
- VariantTag,
- MetaObjectSequence,
- Position,
- UnaryPredicate,
- iterator_pointee_selector<MetaObjectSequence>
- >{ };
-
         /** Gets the initial iterator for the given meta_attributes
          * and unary predicate.
          */
@@ -41,19 +24,21 @@
                 class ReflectedType,
                 class VariantTag,
                 class MetaObjectSequence,
+ class Position,
                 class UnaryPredicate
>
         struct get_meta_object_iterator
         {
                         typedef typename mpl::apply<
- typename meta_object_iterator<
+ typename meta_object_iterator_base<
                                 ReflectedType,
                                 VariantTag,
                                 MetaObjectSequence,
- mpl::int_<0>,
- UnaryPredicate
+ Position,
+ UnaryPredicate,
+ iterator_pointee_selector<MetaObjectSequence>
>::get_initial_iterator,
- mpl::int_<0>
+ Position
>::type type;
         };
 

Added: sandbox/mirror/boost/mirror/algorithm/detail/iterator_comparison.hpp
==============================================================================
--- (empty file)
+++ sandbox/mirror/boost/mirror/algorithm/detail/iterator_comparison.hpp 2008-05-10 06:38:28 EDT (Sat, 10 May 2008)
@@ -0,0 +1,243 @@
+/**
+ * \file boost/mirror/algorithm/detail/iterator_comparison.hpp
+ *
+ * Common boilerplate for iterator comparison.
+ *
+ *
+ * Copyright 2008 Matus Chochlik. Distributed under 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 BOOST_MIRROR_ALGORITHM_DETAIL_ITERATOR_COMPARISON_HPP
+#define BOOST_MIRROR_ALGORITHM_DETAIL_ITERATOR_COMPARISON_HPP
+
+#include <boost/mirror/algorithm/detail/common_iterator.hpp>
+#include <boost/mpl/times.hpp>
+#include <boost/mpl/bool.hpp>
+
+namespace boost {
+namespace mirror {
+namespace detail {
+
+template <
+ class Position1,
+ class Position2,
+ class Direction,
+ template <class, class> class PosCmp
+>
+struct compare_iterator_positions : PosCmp<
+ typename mpl::times<Position1, Direction>::type,
+ typename mpl::times<Position2, Direction>::type
+> { };
+
+
+/** Forward declaration of iterator comparator.
+ * It is intentionaly left undefined.
+ */
+template <
+ class I1,
+ class I2,
+ template <class, class> class PosCmp
+>
+struct compare_iterators;
+
+/** Specialization of compare_iterators<I1, I2> for
+ * I1 = meta_object_iterator_base_templ<...>
+ * I2 = meta_object_iterator_base_templ<...>
+ */
+template <
+ class ReflectedType,
+ class VariantTag,
+ class MetaObjectSequence,
+ class Position1,
+ class Position2,
+ class BeginPos,
+ class EndPos,
+ class Direction,
+ class UnaryPredicate1,
+ class UnaryPredicate2,
+ class Selector,
+ template <class, class> class PosCmp
+>
+struct compare_iterators<
+ meta_object_iterator_base_templ<
+ ReflectedType,
+ VariantTag,
+ MetaObjectSequence,
+ Position1,
+ BeginPos,
+ EndPos,
+ Direction,
+ UnaryPredicate1,
+ Selector
+ >,
+ meta_object_iterator_base_templ<
+ ReflectedType,
+ VariantTag,
+ MetaObjectSequence,
+ Position2,
+ BeginPos,
+ EndPos,
+ Direction,
+ UnaryPredicate2,
+ Selector
+ >,
+ PosCmp
+> : compare_iterator_positions<
+ Position1,
+ Position2,
+ Direction,
+ PosCmp
+> { };
+
+
+/** Specialization of compare_iterators<I1, I2> for
+ * I1 = a concrete Iterator
+ * I2 = meta_object_iterator_base_templ<...>
+ */
+template <
+ template <class, class, class, class, class, class> class Iterator,
+ class ReflectedType,
+ class VariantTag,
+ class MetaObjectSequence,
+ class Position1,
+ class Position2,
+ class BeginPos,
+ class EndPos,
+ class Direction,
+ class UnaryPredicate1,
+ class UnaryPredicate2,
+ class Selector,
+ template <class, class> class PosCmp
+>
+struct compare_iterators<
+ Iterator<
+ ReflectedType,
+ VariantTag,
+ MetaObjectSequence,
+ Position1,
+ UnaryPredicate1,
+ Selector
+ >,
+ meta_object_iterator_base_templ<
+ ReflectedType,
+ VariantTag,
+ MetaObjectSequence,
+ Position2,
+ BeginPos,
+ EndPos,
+ Direction,
+ UnaryPredicate2,
+ Selector
+ >,
+ PosCmp
+> : compare_iterator_positions<
+ Position1,
+ Position2,
+ Direction,
+ PosCmp
+> { };
+
+/** Specialization of compare_iterators<I1, I2> for
+ * I1 = meta_object_iterator_base_templ<...>
+ * I2 = a concrete Iterator
+ */
+template <
+ template <class, class, class, class, class, class> class Iterator,
+ class ReflectedType,
+ class VariantTag,
+ class MetaObjectSequence,
+ class Position1,
+ class Position2,
+ class BeginPos,
+ class EndPos,
+ class Direction,
+ class UnaryPredicate1,
+ class UnaryPredicate2,
+ class Selector,
+ template <class, class> class PosCmp
+>
+struct compare_iterators<
+ meta_object_iterator_base_templ<
+ ReflectedType,
+ VariantTag,
+ MetaObjectSequence,
+ Position1,
+ BeginPos,
+ EndPos,
+ Direction,
+ UnaryPredicate1,
+ Selector
+ >,
+ Iterator<
+ ReflectedType,
+ VariantTag,
+ MetaObjectSequence,
+ Position2,
+ UnaryPredicate2,
+ Selector
+ >,
+ PosCmp
+> : compare_iterator_positions<
+ Position1,
+ Position2,
+ Direction,
+ PosCmp
+> { };
+
+/** Specialization of compare_iterators<I1, I2> for
+ * I1 = a concrete Iterator
+ * I2 = a concrete Iterator
+ */
+template <
+ template <class, class, class, class, class, class> class Iterator,
+ class ReflectedType,
+ class VariantTag,
+ class MetaObjectSequence,
+ class Position1,
+ class Position2,
+ class UnaryPredicate1,
+ class UnaryPredicate2,
+ class Selector,
+ template <class, class> class PosCmp
+>
+struct compare_iterators<
+ Iterator<
+ ReflectedType,
+ VariantTag,
+ MetaObjectSequence,
+ Position1,
+ UnaryPredicate1,
+ Selector
+ >,
+ Iterator<
+ ReflectedType,
+ VariantTag,
+ MetaObjectSequence,
+ Position2,
+ UnaryPredicate2,
+ Selector
+ >,
+ PosCmp
+> : compare_iterator_positions<
+ Position1,
+ Position2,
+ typename Iterator<
+ ReflectedType,
+ VariantTag,
+ MetaObjectSequence,
+ Position1,
+ UnaryPredicate1,
+ Selector
+ >::direction,
+ PosCmp
+> { };
+
+
+} // namespace detail
+} // namespace mirror
+} // namespace boost
+
+#endif //include guard
+

Added: sandbox/mirror/boost/mirror/algorithm/detail/positional.hpp
==============================================================================
--- (empty file)
+++ sandbox/mirror/boost/mirror/algorithm/detail/positional.hpp 2008-05-10 06:38:28 EDT (Sat, 10 May 2008)
@@ -0,0 +1,110 @@
+/**
+ * \file boost/mirror/algorithm/detail/positional.hpp
+ *
+ * Common boilerplate for iterator getters.
+ *
+ *
+ * Copyright 2008 Matus Chochlik. Distributed under 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 BOOST_MIRROR_ALGORITHM_DETAIL_POSITIONAL_HPP
+#define BOOST_MIRROR_ALGORITHM_DETAIL_POSITIONAL_HPP
+
+#include <boost/mirror/meta_attributes.hpp>
+#include <boost/mirror/meta_inheritance.hpp>
+
+namespace boost {
+namespace mirror {
+namespace detail {
+
+ /** Declaration of the default position_getter_impl_1
+ * helper template.
+ */
+ template <
+ class MetaObjectSequence,
+ class Arg1,
+ template <class, class, class, class> class Implementation
+ >
+ struct position_getter_impl_1 { };
+
+ /** Specialization of position_getter_impl_1<MetaObjectSequence>
+ * for meta_class_attributes<>
+ */
+ template <
+ class Class,
+ class VariantTag,
+ class Arg1,
+ template <class, class, class, class> class Implementation
+ >
+ struct position_getter_impl_1<
+ meta_class_attributes<Class, VariantTag>,
+ Arg1,
+ Implementation
+ >
+ : Implementation<
+ Class, VariantTag,
+ meta_class_attributes<Class, VariantTag>,
+ Arg1
+ >{ };
+
+ /** Specialization of for_each_impl_1<MetaObjectSequence>
+ * for meta_class_all_attributes<>
+ */
+ template <
+ class Class,
+ class VariantTag,
+ class Arg1,
+ template <class, class, class, class> class Implementation
+ >
+ struct position_getter_impl_1<
+ meta_class_all_attributes<Class, VariantTag>,
+ Arg1,
+ Implementation
+ >
+ : Implementation<
+ Class, VariantTag,
+ meta_class_all_attributes<Class, VariantTag>,
+ Arg1
+ >{ };
+
+ /** Specialization of position_getter_impl_1<MetaObjectSequence>
+ * for meta_base_classes<>
+ */
+ template <
+ class Class,
+ class VariantTag,
+ class Arg1,
+ template <class, class, class, class> class Implementation
+ >
+ struct position_getter_impl_1<
+ meta_base_classes<Class, VariantTag>,
+ Arg1,
+ Implementation
+ >
+ : Implementation<
+ Class, VariantTag,
+ meta_base_classes<Class, VariantTag>,
+ Arg1
+ >{ };
+
+ /** Declaration of the default position_getter_impl
+ * helper template.
+ */
+ template <
+ class MetaObjectSequence,
+ template <class, class, class, class> class Implementation
+ >
+ struct position_getter_impl
+ : position_getter_impl_1<MetaObjectSequence, void, Implementation>
+ { };
+
+
+
+} // namespace detail
+} // namespace mirror
+} // namespace boost
+
+#endif //include guard
+

Added: sandbox/mirror/boost/mirror/algorithm/detail/rbegin.hpp
==============================================================================
--- (empty file)
+++ sandbox/mirror/boost/mirror/algorithm/detail/rbegin.hpp 2008-05-10 06:38:28 EDT (Sat, 10 May 2008)
@@ -0,0 +1,43 @@
+/**
+ * \file boost/mirror/algorithm/detail/rbegin.hpp
+ * Template returning the iterator poining to
+ * the last element in a meta object sequence.
+ *
+ * Copyright 2008 Matus Chochlik. Distributed under 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 BOOST_MIRROR_ALGORITHM_DETAIL_RBEGIN_HPP
+#define BOOST_MIRROR_ALGORITHM_DETAIL_RBEGIN_HPP
+
+#include <boost/mirror/algorithm/detail/reverse_iterator.hpp>
+#include <boost/mpl/always.hpp>
+
+namespace boost {
+namespace mirror {
+namespace detail {
+
+ template <
+ class ReflectedType,
+ class VariantTag,
+ class MetaObjectSequence,
+ class Dummy
+ >
+ struct meta_object_sequence_rbegin
+ {
+ typedef typename get_meta_object_reverse_iterator<
+ ReflectedType,
+ VariantTag,
+ MetaObjectSequence,
+ mpl::int_<size<MetaObjectSequence>::value - 1>,
+ mpl::always<mpl::true_>
+ >::type type;
+ };
+
+} // namespace detail
+} // namespace mirror
+} // namespace boost
+
+#endif //include guard
+

Added: sandbox/mirror/boost/mirror/algorithm/detail/rend.hpp
==============================================================================
--- (empty file)
+++ sandbox/mirror/boost/mirror/algorithm/detail/rend.hpp 2008-05-10 06:38:28 EDT (Sat, 10 May 2008)
@@ -0,0 +1,44 @@
+/**
+ * \file boost/mirror/algorithm/detail/rend.hpp
+ * Template returning the iterator poining before
+ * the first element in a meta object sequence.
+ *
+ * Copyright 2008 Matus Chochlik. Distributed under 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 BOOST_MIRROR_ALGORITHM_DETAIL_REND_HPP
+#define BOOST_MIRROR_ALGORITHM_DETAIL_REND_HPP
+
+#include <boost/mirror/algorithm/detail/iterator.hpp>
+#include <boost/mpl/always.hpp>
+
+namespace boost {
+namespace mirror {
+namespace detail {
+
+ template <
+ class ReflectedType,
+ class VariantTag,
+ class MetaObjectSequence,
+ class Dummy
+ >
+ struct meta_object_sequence_rend
+ {
+ typedef typename get_meta_object_reverse_iterator<
+ ReflectedType,
+ VariantTag,
+ MetaObjectSequence,
+ mpl::int_<-1>,
+ mpl::always<mpl::true_>
+ >::type type;
+ };
+
+
+} // namespace detail
+} // namespace mirror
+} // namespace boost
+
+#endif //include guard
+

Added: sandbox/mirror/boost/mirror/algorithm/detail/reverse_find_if.hpp
==============================================================================
--- (empty file)
+++ sandbox/mirror/boost/mirror/algorithm/detail/reverse_find_if.hpp 2008-05-10 06:38:28 EDT (Sat, 10 May 2008)
@@ -0,0 +1,43 @@
+/**
+ * \file boost/mirror/algorithm/detail/reverse_find_if.hpp
+ *
+ * Returns iterator to the first-from-end element of a meta-object
+ * sequence satisfying the predicate.
+ *
+ * Copyright 2008 Matus Chochlik. Distributed under 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 BOOST_MIRROR_ALGORITHM_DETAIL_REVERSE_FIND_IF_HPP
+#define BOOST_MIRROR_ALGORITHM_DETAIL_REVERSE_FIND_IF_HPP
+
+#include <boost/mirror/algorithm/detail/reverse_iterator.hpp>
+
+namespace boost {
+namespace mirror {
+namespace detail {
+
+ template <
+ class ReflectedType,
+ class VariantTag,
+ class MetaObjectSequence,
+ class Predicate
+ >
+ struct meta_object_reverse_find_if
+ {
+ typedef typename get_meta_object_reverse_iterator<
+ ReflectedType,
+ VariantTag,
+ MetaObjectSequence,
+ mpl::int_<size<MetaObjectSequence>::value - 1>,
+ Predicate
+ >::type type;
+ };
+
+} // namespace detail
+} // namespace mirror
+} // namespace boost
+
+#endif //include guard
+

Added: sandbox/mirror/boost/mirror/algorithm/detail/reverse_iterator.hpp
==============================================================================
--- (empty file)
+++ sandbox/mirror/boost/mirror/algorithm/detail/reverse_iterator.hpp 2008-05-10 06:38:28 EDT (Sat, 10 May 2008)
@@ -0,0 +1,52 @@
+/**
+ * \file boost/mirror/algorithm/detail/reverse_iterator.hpp
+ * Includes all meta-object sequence reverse_iterators
+ *
+ * Copyright 2008 Matus Chochlik. Distributed under 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 BOOST_MIRROR_ALGORITHM_DETAIL_REVERSE_ITERATOR_HPP
+#define BOOST_MIRROR_ALGORITHM_DETAIL_REVERSE_ITERATOR_HPP
+
+#include <boost/mirror/algorithm/detail/attribute_iterator.hpp>
+#include <boost/mirror/algorithm/detail/base_class_iterator.hpp>
+
+namespace boost {
+namespace mirror {
+namespace detail {
+
+ /** Gets the initial reverse_iterator for the given meta_attributes
+ * and unary predicate.
+ */
+ template <
+ class ReflectedType,
+ class VariantTag,
+ class MetaObjectSequence,
+ class Position,
+ class UnaryPredicate
+ >
+ struct get_meta_object_reverse_iterator
+ {
+ typedef typename mpl::apply<
+ typename meta_object_reverse_iterator_base<
+ ReflectedType,
+ VariantTag,
+ MetaObjectSequence,
+ Position,
+ UnaryPredicate,
+ iterator_pointee_selector<MetaObjectSequence>
+ >::get_initial_iterator,
+ Position
+ >::type type;
+ };
+
+
+
+} // namespace detail
+} // namespace mirror
+} // namespace boost
+
+#endif //include guard
+

Modified: sandbox/mirror/boost/mirror/algorithm/end.hpp
==============================================================================
--- sandbox/mirror/boost/mirror/algorithm/end.hpp (original)
+++ sandbox/mirror/boost/mirror/algorithm/end.hpp 2008-05-10 06:38:28 EDT (Sat, 10 May 2008)
@@ -12,46 +12,16 @@
 #define BOOST_MIRROR_ALGORITHM_END_HPP
 
 #include <boost/mirror/algorithm/detail/end.hpp>
+#include <boost/mirror/algorithm/detail/positional.hpp>
 
 namespace boost {
 namespace mirror {
 namespace detail {
 
- /** Declaration of the default end_impl
- * helper template.
- */
         template <class MetaObjectSequence>
- struct end_impl { };
-
- /** Specialization of end_impl<MetaObjectSequence>
- * for meta_class_attributes<>
- */
- template <class Class, class VariantTag>
- struct end_impl<meta_class_attributes<Class, VariantTag> >
- : meta_object_sequence_end<
- Class, VariantTag,
- meta_class_attributes<Class, VariantTag>
- >{ };
-
- /** Specialization of for_each_impl<MetaObjectSequence>
- * for meta_class_all_attributes<>
- */
- template <class Class, class VariantTag>
- struct end_impl<meta_class_all_attributes<Class, VariantTag> >
- : meta_object_sequence_end<
- Class, VariantTag,
- meta_class_all_attributes<Class, VariantTag>
- >{ };
-
- /** Specialization of for_each_impl<MetaObjectSequence>
- * for meta_base_classes<>
- */
- template <class Class, class VariantTag>
- struct end_impl<meta_base_classes<Class, VariantTag> >
- : meta_object_sequence_end<
- Class, VariantTag,
- meta_base_classes<Class, VariantTag>
- >{ };
+ struct end_impl
+ : position_getter_impl<MetaObjectSequence, meta_object_sequence_end>
+ { };
 
 } // namespace detail
 

Modified: sandbox/mirror/boost/mirror/algorithm/find_if.hpp
==============================================================================
--- sandbox/mirror/boost/mirror/algorithm/find_if.hpp (original)
+++ sandbox/mirror/boost/mirror/algorithm/find_if.hpp 2008-05-10 06:38:28 EDT (Sat, 10 May 2008)
@@ -13,49 +13,16 @@
 #define BOOST_MIRROR_ALGORITHM_FIND_IF_HPP
 
 #include <boost/mirror/algorithm/detail/find_if.hpp>
+#include <boost/mirror/algorithm/detail/positional.hpp>
 
 namespace boost {
 namespace mirror {
 namespace detail {
 
- /** Declaration of the default find_if_impl
- * helper template.
- */
         template <class MetaObjectSequence, class Predicate>
- struct find_if_impl { };
-
- /** Specialization of find_if_impl<MetaObjectSequence, class Predicate>
- * for meta_class_attributes<>
- */
- template <class Class, class VariantTag, class Predicate>
- struct find_if_impl<meta_class_attributes<Class, VariantTag>, Predicate>
- : meta_object_find_if<
- Class, VariantTag,
- meta_class_attributes<Class, VariantTag>,
- Predicate
- >{ };
-
- /** Specialization of for_each_impl<MetaObjectSequence>
- * for meta_class_all_attributes<>
- */
- template <class Class, class VariantTag, class Predicate>
- struct find_if_impl<meta_class_all_attributes<Class, VariantTag>, Predicate>
- : meta_object_find_if<
- Class, VariantTag,
- meta_class_all_attributes<Class, VariantTag>,
- Predicate
- >{ };
-
- /** Specialization of for_each_impl<MetaObjectSequence>
- * for meta_base_classes<>
- */
- template <class Class, class VariantTag, class Predicate>
- struct find_if_impl<meta_base_classes<Class, VariantTag>, Predicate>
- : meta_object_find_if<
- Class, VariantTag,
- meta_base_classes<Class, VariantTag>,
- Predicate
- >{ };
+ struct find_if_impl
+ : position_getter_impl_1<MetaObjectSequence, Predicate, meta_object_find_if>
+ { };
 
 } // namespace detail
 

Deleted: sandbox/mirror/boost/mirror/algorithm/is_equal_iterator.hpp
==============================================================================
--- sandbox/mirror/boost/mirror/algorithm/is_equal_iterator.hpp 2008-05-10 06:38:28 EDT (Sat, 10 May 2008)
+++ (empty file)
@@ -1,81 +0,0 @@
-/**
- * \file boost/mirror/algorithm/is_equal_iterator.hpp
- *
- * Iterator equality comparison
- *
- * Copyright 2008 Matus Chochlik. Distributed under 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 BOOST_MIRROR_ALGORITHM_IS_EQUAL_ITERATOR_HPP
-#define BOOST_MIRROR_ALGORITHM_IS_EQUAL_ITERATOR_HPP
-
-#include <boost/mirror/algorithm/detail/iterator.hpp>
-#include <boost/mpl/bool.hpp>
-
-namespace boost {
-namespace mirror {
-
-template <class U, class V>
-struct is_equal_iterator : mpl::false_ { };
-
-
-template <
- class ReflectedType,
- class VariantTag,
- class MetaAttributes,
- class AttribPos,
- class UnaryPredicate1,
- class UnaryPredicate2,
- class Selector
->
-struct is_equal_iterator<
- detail::meta_object_iterator<
- ReflectedType,
- VariantTag,
- MetaAttributes,
- AttribPos,
- UnaryPredicate1
- >,
- detail::meta_object_iterator_base<
- ReflectedType,
- VariantTag,
- MetaAttributes,
- AttribPos,
- UnaryPredicate2,
- Selector
- >
-> : mpl::true_ { };
-
-template <
- class ReflectedType,
- class VariantTag,
- class MetaAttributes,
- class AttribPos,
- class UnaryPredicate1,
- class UnaryPredicate2
->
-struct is_equal_iterator<
- detail::meta_object_iterator<
- ReflectedType,
- VariantTag,
- MetaAttributes,
- AttribPos,
- UnaryPredicate1
- >,
- detail::meta_object_iterator<
- ReflectedType,
- VariantTag,
- MetaAttributes,
- AttribPos,
- UnaryPredicate2
- >
-> : mpl::true_ { };
-
-
-} // namespace mirror
-} // namespace boost
-
-#endif //include guard
-

Added: sandbox/mirror/boost/mirror/algorithm/iterator_comparison.hpp
==============================================================================
--- (empty file)
+++ sandbox/mirror/boost/mirror/algorithm/iterator_comparison.hpp 2008-05-10 06:38:28 EDT (Sat, 10 May 2008)
@@ -0,0 +1,28 @@
+/**
+ * \file boost/mirror/algorithm/iterator_comparison.hpp
+ *
+ * Iterator comparison
+ *
+ * Copyright 2008 Matus Chochlik. Distributed under 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 BOOST_MIRROR_ALGORITHM_ITERATOR_COMPARISON_HPP
+#define BOOST_MIRROR_ALGORITHM_ITERATOR_COMPARISON_HPP
+
+#include <boost/mirror/algorithm/iterator_equal.hpp>
+#include <boost/mirror/algorithm/iterator_not_equal.hpp>
+#include <boost/mirror/algorithm/iterator_less.hpp>
+#include <boost/mirror/algorithm/iterator_less_equal.hpp>
+#include <boost/mirror/algorithm/iterator_greater.hpp>
+#include <boost/mirror/algorithm/iterator_greater_equal.hpp>
+
+namespace boost {
+namespace mirror {
+
+} // namespace mirror
+} // namespace boost
+
+#endif //include guard
+

Added: sandbox/mirror/boost/mirror/algorithm/iterator_equal.hpp
==============================================================================
--- (empty file)
+++ sandbox/mirror/boost/mirror/algorithm/iterator_equal.hpp 2008-05-10 06:38:28 EDT (Sat, 10 May 2008)
@@ -0,0 +1,30 @@
+/**
+ * \file boost/mirror/algorithm/iterator_equal.hpp
+ *
+ * Iterator equality comparison
+ *
+ * Copyright 2008 Matus Chochlik. Distributed under 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 BOOST_MIRROR_ALGORITHM_ITERATOR_EQUAL_HPP
+#define BOOST_MIRROR_ALGORITHM_ITERATOR_EQUAL_HPP
+
+#include <boost/mirror/algorithm/detail/iterator_comparison.hpp>
+#include <boost/mpl/equal_to.hpp>
+
+namespace boost {
+namespace mirror {
+
+template <class I1, class I2>
+struct iterator_equal
+: detail::compare_iterators<I1, I2, mpl::equal_to>
+{ };
+
+
+} // namespace mirror
+} // namespace boost
+
+#endif //include guard
+

Added: sandbox/mirror/boost/mirror/algorithm/iterator_greater.hpp
==============================================================================
--- (empty file)
+++ sandbox/mirror/boost/mirror/algorithm/iterator_greater.hpp 2008-05-10 06:38:28 EDT (Sat, 10 May 2008)
@@ -0,0 +1,30 @@
+/**
+ * \file boost/mirror/algorithm/iterator_greater.hpp
+ *
+ * Iterator greater than comparison
+ *
+ * Copyright 2008 Matus Chochlik. Distributed under 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 BOOST_MIRROR_ALGORITHM_ITERATOR_GREATER_HPP
+#define BOOST_MIRROR_ALGORITHM_ITERATOR_GREATER_HPP
+
+#include <boost/mirror/algorithm/detail/iterator_comparison.hpp>
+#include <boost/mpl/greater.hpp>
+
+namespace boost {
+namespace mirror {
+
+template <class I1, class I2>
+struct iterator_greater
+: detail::compare_iterators<I1, I2, mpl::greater>
+{ };
+
+
+} // namespace mirror
+} // namespace boost
+
+#endif //include guard
+

Added: sandbox/mirror/boost/mirror/algorithm/iterator_greater_equal.hpp
==============================================================================
--- (empty file)
+++ sandbox/mirror/boost/mirror/algorithm/iterator_greater_equal.hpp 2008-05-10 06:38:28 EDT (Sat, 10 May 2008)
@@ -0,0 +1,30 @@
+/**
+ * \file boost/mirror/algorithm/iterator_greater_equal.hpp
+ *
+ * Iterator greater than or equal comparison
+ *
+ * Copyright 2008 Matus Chochlik. Distributed under 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 BOOST_MIRROR_ALGORITHM_ITERATOR_GREATER_EQUAL_HPP
+#define BOOST_MIRROR_ALGORITHM_ITERATOR_GREATER_EQUAL_HPP
+
+#include <boost/mirror/algorithm/detail/iterator_comparison.hpp>
+#include <boost/mpl/greater_equal.hpp>
+
+namespace boost {
+namespace mirror {
+
+template <class I1, class I2>
+struct iterator_greater_equal
+: detail::compare_iterators<I1, I2, mpl::greater_equal>
+{ };
+
+
+} // namespace mirror
+} // namespace boost
+
+#endif //include guard
+

Added: sandbox/mirror/boost/mirror/algorithm/iterator_less.hpp
==============================================================================
--- (empty file)
+++ sandbox/mirror/boost/mirror/algorithm/iterator_less.hpp 2008-05-10 06:38:28 EDT (Sat, 10 May 2008)
@@ -0,0 +1,30 @@
+/**
+ * \file boost/mirror/algorithm/iterator_less.hpp
+ *
+ * Iterator less than comparison
+ *
+ * Copyright 2008 Matus Chochlik. Distributed under 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 BOOST_MIRROR_ALGORITHM_ITERATOR_LESS_HPP
+#define BOOST_MIRROR_ALGORITHM_ITERATOR_LESS_HPP
+
+#include <boost/mirror/algorithm/detail/iterator_comparison.hpp>
+#include <boost/mpl/less.hpp>
+
+namespace boost {
+namespace mirror {
+
+template <class I1, class I2>
+struct iterator_less
+: detail::compare_iterators<I1, I2, mpl::less>
+{ };
+
+
+} // namespace mirror
+} // namespace boost
+
+#endif //include guard
+

Added: sandbox/mirror/boost/mirror/algorithm/iterator_less_equal.hpp
==============================================================================
--- (empty file)
+++ sandbox/mirror/boost/mirror/algorithm/iterator_less_equal.hpp 2008-05-10 06:38:28 EDT (Sat, 10 May 2008)
@@ -0,0 +1,30 @@
+/**
+ * \file boost/mirror/algorithm/iterator_less_equal.hpp
+ *
+ * Iterator less than or equal comparison
+ *
+ * Copyright 2008 Matus Chochlik. Distributed under 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 BOOST_MIRROR_ALGORITHM_ITERATOR_LESS_EQUAL_HPP
+#define BOOST_MIRROR_ALGORITHM_ITERATOR_LESS_EQUAL_HPP
+
+#include <boost/mirror/algorithm/detail/iterator_comparison.hpp>
+#include <boost/mpl/less_equal.hpp>
+
+namespace boost {
+namespace mirror {
+
+template <class I1, class I2>
+struct iterator_less_equal
+: detail::compare_iterators<I1, I2, mpl::less_equal>
+{ };
+
+
+} // namespace mirror
+} // namespace boost
+
+#endif //include guard
+

Added: sandbox/mirror/boost/mirror/algorithm/iterator_not_equal.hpp
==============================================================================
--- (empty file)
+++ sandbox/mirror/boost/mirror/algorithm/iterator_not_equal.hpp 2008-05-10 06:38:28 EDT (Sat, 10 May 2008)
@@ -0,0 +1,30 @@
+/**
+ * \file boost/mirror/algorithm/iterator_not_equal.hpp
+ *
+ * Iterator inequality comparison
+ *
+ * Copyright 2008 Matus Chochlik. Distributed under 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 BOOST_MIRROR_ALGORITHM_ITERATOR_NOT_EQUAL_HPP
+#define BOOST_MIRROR_ALGORITHM_ITERATOR_NOT_EQUAL_HPP
+
+#include <boost/mirror/algorithm/detail/iterator_comparison.hpp>
+#include <boost/mpl/not_equal_to.hpp>
+
+namespace boost {
+namespace mirror {
+
+template <class I1, class I2>
+struct iterator_not_equal
+: detail::compare_iterators<I1, I2, mpl::not_equal_to>
+{ };
+
+
+} // namespace mirror
+} // namespace boost
+
+#endif //include guard
+

Added: sandbox/mirror/boost/mirror/algorithm/rbegin.hpp
==============================================================================
--- (empty file)
+++ sandbox/mirror/boost/mirror/algorithm/rbegin.hpp 2008-05-10 06:38:28 EDT (Sat, 10 May 2008)
@@ -0,0 +1,36 @@
+/**
+ * \file boost/mirror/algorithm/rbegin.hpp
+ * Returns the revverse iterator pointing to the last meta-object
+ * in a meta-object sequence.
+ *
+ * Copyright 2008 Matus Chochlik. Distributed under 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 BOOST_MIRROR_ALGORITHM_RBEGIN_HPP
+#define BOOST_MIRROR_ALGORITHM_RBEGIN_HPP
+
+#include <boost/mirror/algorithm/detail/rbegin.hpp>
+#include <boost/mirror/algorithm/detail/positional.hpp>
+
+namespace boost {
+namespace mirror {
+namespace detail {
+
+ template <class MetaObjectSequence>
+ struct rbegin_impl
+ : position_getter_impl<MetaObjectSequence, meta_object_sequence_rbegin>
+ { };
+
+} // namespace detail
+
+template <class MetaObjectSequence>
+struct rbegin : detail::rbegin_impl<MetaObjectSequence>
+{ };
+
+} // namespace mirror
+} // namespace boost
+
+#endif //include guard
+

Added: sandbox/mirror/boost/mirror/algorithm/rend.hpp
==============================================================================
--- (empty file)
+++ sandbox/mirror/boost/mirror/algorithm/rend.hpp 2008-05-10 06:38:28 EDT (Sat, 10 May 2008)
@@ -0,0 +1,36 @@
+/**
+ * \file boost/mirror/algorithm/rend.hpp
+ * Returns the reverse iterator pointing before the first meta-object
+ * in a meta-object sequence.
+ *
+ * Copyright 2008 Matus Chochlik. Distributed under 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 BOOST_MIRROR_ALGORITHM_REND_HPP
+#define BOOST_MIRROR_ALGORITHM_REND_HPP
+
+#include <boost/mirror/algorithm/detail/rend.hpp>
+#include <boost/mirror/algorithm/detail/positional.hpp>
+
+namespace boost {
+namespace mirror {
+namespace detail {
+
+ template <class MetaObjectSequence>
+ struct rend_impl
+ : position_getter_impl<MetaObjectSequence, meta_object_sequence_rend>
+ { };
+
+} // namespace detail
+
+template <class MetaObjectSequence>
+struct rend : detail::rend_impl<MetaObjectSequence>
+{ };
+
+} // namespace mirror
+} // namespace boost
+
+#endif //include guard
+

Added: sandbox/mirror/boost/mirror/algorithm/reverse_find_if.hpp
==============================================================================
--- (empty file)
+++ sandbox/mirror/boost/mirror/algorithm/reverse_find_if.hpp 2008-05-10 06:38:28 EDT (Sat, 10 May 2008)
@@ -0,0 +1,37 @@
+/**
+ * \file boost/mirror/algorithm/reverse_find_if.hpp
+ *
+ * Returns the reverse iterator pointing to the first-from-end meta-object
+ * in a meta-object sequence satisfying the given predicate.
+ *
+ * Copyright 2008 Matus Chochlik. Distributed under 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 BOOST_MIRROR_ALGORITHM_REVERSE_FIND_IF_HPP
+#define BOOST_MIRROR_ALGORITHM_REVERSE_FIND_IF_HPP
+
+#include <boost/mirror/algorithm/detail/reverse_find_if.hpp>
+#include <boost/mirror/algorithm/detail/positional.hpp>
+
+namespace boost {
+namespace mirror {
+namespace detail {
+
+ template <class MetaObjectSequence, class Predicate>
+ struct reverse_find_if_impl
+ : position_getter_impl_1<MetaObjectSequence, Predicate, meta_object_reverse_find_if>
+ { };
+
+} // namespace detail
+
+template <class MetaObjectSequence, class Predicate>
+struct reverse_find_if : detail::reverse_find_if_impl<MetaObjectSequence, Predicate>
+{ };
+
+} // namespace mirror
+} // namespace boost
+
+#endif //include guard
+

Modified: sandbox/mirror/boost/mirror/algorithms.hpp
==============================================================================
--- sandbox/mirror/boost/mirror/algorithms.hpp (original)
+++ sandbox/mirror/boost/mirror/algorithms.hpp 2008-05-10 06:38:28 EDT (Sat, 10 May 2008)
@@ -12,12 +12,17 @@
 
 #include <boost/mirror/algorithm/begin.hpp>
 #include <boost/mirror/algorithm/end.hpp>
+#include <boost/mirror/algorithm/rbegin.hpp>
+#include <boost/mirror/algorithm/rend.hpp>
 #include <boost/mirror/algorithm/prior.hpp>
 #include <boost/mirror/algorithm/next.hpp>
-#include <boost/mirror/algorithm/is_equal_iterator.hpp>
+
+#include <boost/mirror/algorithm/iterator_comparison.hpp>
+
 #include <boost/mirror/algorithm/for_each.hpp>
 #include <boost/mirror/algorithm/reverse_for_each.hpp>
 #include <boost/mirror/algorithm/find_if.hpp>
+#include <boost/mirror/algorithm/reverse_find_if.hpp>
 
 namespace boost {
 namespace mirror {

Modified: sandbox/mirror/libs/mirror/doc/xml/mirror/_library.xml
==============================================================================
--- sandbox/mirror/libs/mirror/doc/xml/mirror/_library.xml (original)
+++ sandbox/mirror/libs/mirror/doc/xml/mirror/_library.xml 2008-05-10 06:38:28 EDT (Sat, 10 May 2008)
@@ -153,5 +153,9 @@
                         - NOTE: Some example from this revision will probably not compile
                         - NOTE: Not tested
                 </revision>
+ <revision id="20080510" major="0" minor="1" micro="23" author="m_ch">
+ - Added rbegin, rend, reverse_find_if
+ - Tested with MSVC++ 2008 EE
+ </revision>
         </revisions>
 </library>

Modified: sandbox/mirror/libs/mirror/example/algorithms/begin_end.cpp
==============================================================================
--- sandbox/mirror/libs/mirror/example/algorithms/begin_end.cpp (original)
+++ sandbox/mirror/libs/mirror/example/algorithms/begin_end.cpp 2008-05-10 06:38:28 EDT (Sat, 10 May 2008)
@@ -1,7 +1,7 @@
 /**
  * \file examples/special/boost_tuple.cpp
  *
- * Example showing reflection of boost::tuples
+ * Example showing meta-object iterator usage
  *
  * Copyright 2008 Matus Chochlik. Distributed under the Boost
  * Software License, Version 1.0. (See accompanying file
@@ -68,6 +68,49 @@
         typedef BOOST_MIRROR_REFLECT_CLASS(T) meta_T;
         //
         //
+ BOOST_STATIC_ASSERT((iterator_not_equal<
+ begin<meta_T::all_attributes>::type,
+ end<meta_T::all_attributes>::type
+ >::value));
+ BOOST_STATIC_ASSERT((iterator_less<
+ begin<meta_T::all_attributes>::type,
+ end<meta_T::all_attributes>::type
+ >::value));
+ BOOST_STATIC_ASSERT((iterator_greater<
+ end<meta_T::all_attributes>::type,
+ begin<meta_T::all_attributes>::type
+ >::value));
+ BOOST_STATIC_ASSERT((iterator_less_equal<
+ begin<meta_T::all_attributes>::type,
+ end<meta_T::all_attributes>::type
+ >::value));
+ BOOST_STATIC_ASSERT((iterator_greater_equal<
+ end<meta_T::all_attributes>::type,
+ begin<meta_T::all_attributes>::type
+ >::value));
+ //
+ BOOST_STATIC_ASSERT((iterator_not_equal<
+ rbegin<meta_T::all_attributes>::type,
+ rend<meta_T::all_attributes>::type
+ >::value));
+ BOOST_STATIC_ASSERT((iterator_less<
+ rbegin<meta_T::all_attributes>::type,
+ rend<meta_T::all_attributes>::type
+ >::value));
+ BOOST_STATIC_ASSERT((iterator_greater<
+ rend<meta_T::all_attributes>::type,
+ rbegin<meta_T::all_attributes>::type
+ >::value));
+ BOOST_STATIC_ASSERT((iterator_less_equal<
+ rbegin<meta_T::all_attributes>::type,
+ rend<meta_T::all_attributes>::type
+ >::value));
+ BOOST_STATIC_ASSERT((iterator_greater_equal<
+ rend<meta_T::all_attributes>::type,
+ rbegin<meta_T::all_attributes>::type
+ >::value));
+ //
+ //
         typedef begin<meta_T::all_attributes>::type i_0;
         bcout << deref<i_0>::type::base_name() << ',' ;
         typedef next<i_0>::type i_1;
@@ -88,36 +131,86 @@
         bcout << deref<i_8>::type::base_name() << endl ;
         typedef next<i_8>::type i_end;
         //
- BOOST_STATIC_ASSERT((is_equal_iterator<
+ BOOST_STATIC_ASSERT((iterator_equal<
                 end<meta_T::all_attributes>::type, i_end
>::value));
         //
         bcout << "---------------------------------------------------" << endl;
         typedef prior<i_end>::type j_8;
         bcout << deref<j_8>::type::base_name() << ',' ;
- typedef prior<i_8>::type j_7;
+ typedef prior<j_8>::type j_7;
         bcout << deref<j_7>::type::base_name() << ',' ;
- typedef prior<i_7>::type j_6;
+ typedef prior<j_7>::type j_6;
         bcout << deref<j_6>::type::base_name() << ',' ;
- typedef prior<i_6>::type j_5;
+ typedef prior<j_6>::type j_5;
         bcout << deref<j_5>::type::base_name() << ',' ;
- typedef prior<i_5>::type j_4;
+ typedef prior<j_5>::type j_4;
         bcout << deref<j_4>::type::base_name() << ',' ;
- typedef prior<i_4>::type j_3;
+ typedef prior<j_4>::type j_3;
         bcout << deref<j_3>::type::base_name() << ',' ;
- typedef prior<i_3>::type j_2;
+ typedef prior<j_3>::type j_2;
         bcout << deref<j_2>::type::base_name() << ',' ;
- typedef prior<i_2>::type j_1;
+ typedef prior<j_2>::type j_1;
         bcout << deref<j_1>::type::base_name() << ',' ;
- typedef prior<i_1>::type j_0;
+ typedef prior<j_1>::type j_0;
         bcout << deref<j_0>::type::base_name() << endl ;
         typedef j_0 j_begin;
         //
- BOOST_STATIC_ASSERT((is_equal_iterator<
+ BOOST_STATIC_ASSERT((iterator_equal<
                 begin<meta_T::all_attributes>::type, j_begin
>::value));
         //
         bcout << "---------------------------------------------------" << endl;
+ typedef rbegin<meta_T::all_attributes>::type r_8;
+ bcout << deref<r_8>::type::base_name() << ',' ;
+ typedef next<r_8>::type r_7;
+ bcout << deref<r_7>::type::base_name() << ',' ;
+ typedef next<r_7>::type r_6;
+ bcout << deref<r_6>::type::base_name() << ',' ;
+ typedef next<r_6>::type r_5;
+ bcout << deref<r_5>::type::base_name() << ',' ;
+ typedef next<r_5>::type r_4;
+ bcout << deref<r_4>::type::base_name() << ',' ;
+ typedef next<r_4>::type r_3;
+ bcout << deref<r_3>::type::base_name() << ',' ;
+ typedef next<r_3>::type r_2;
+ bcout << deref<r_2>::type::base_name() << ',' ;
+ typedef next<r_2>::type r_1;
+ bcout << deref<r_1>::type::base_name() << ',' ;
+ typedef next<r_1>::type r_0;
+ bcout << deref<r_0>::type::base_name() << endl ;
+ typedef next<r_0>::type r_end;
+ //
+ BOOST_STATIC_ASSERT((iterator_equal<
+ rend<meta_T::all_attributes>::type, r_end
+ >::value));
+ //
+ bcout << "---------------------------------------------------" << endl;
+ typedef prior<r_end>::type p_0;
+ bcout << deref<p_0>::type::base_name() << ',' ;
+ typedef prior<p_0>::type p_1;
+ bcout << deref<p_1>::type::base_name() << ',' ;
+ typedef prior<p_1>::type p_2;
+ bcout << deref<p_2>::type::base_name() << ',' ;
+ typedef prior<p_2>::type p_3;
+ bcout << deref<p_3>::type::base_name() << ',' ;
+ typedef prior<p_3>::type p_4;
+ bcout << deref<p_4>::type::base_name() << ',' ;
+ typedef prior<p_4>::type p_5;
+ bcout << deref<p_5>::type::base_name() << ',' ;
+ typedef prior<p_5>::type p_6;
+ bcout << deref<p_6>::type::base_name() << ',' ;
+ typedef prior<p_6>::type p_7;
+ bcout << deref<p_7>::type::base_name() << ',' ;
+ typedef prior<p_7>::type p_8;
+ bcout << deref<p_8>::type::base_name() << endl ;
+ typedef p_8 p_rbegin;
+ //
+ BOOST_STATIC_ASSERT((iterator_equal<
+ rbegin<meta_T::all_attributes>::type, p_rbegin
+ >::value));
+ //
+ bcout << "---------------------------------------------------" << endl;
         //
         typedef find_if<meta_T::all_attributes, is_even_attrib>::type n_0;
         bcout << deref<n_0>::type::base_name() << ',' ;
@@ -131,7 +224,7 @@
         bcout << deref<n_8>::type::base_name() << endl ;
         typedef next<n_8>::type n_end;
         //
- BOOST_STATIC_ASSERT((is_equal_iterator<
+ BOOST_STATIC_ASSERT((iterator_equal<
                 end<meta_T::all_attributes>::type, n_end
>::value));
         //
@@ -147,12 +240,30 @@
         bcout << deref<m_7>::type::base_name() << endl ;
         typedef next<m_7>::type m_end;
         //
- BOOST_STATIC_ASSERT((is_equal_iterator<
+ BOOST_STATIC_ASSERT((iterator_equal<
                 end<meta_T::all_attributes>::type, m_end
>::value));
         //
         bcout << "---------------------------------------------------" << endl;
         //
+ /*
+ typedef reverse_find_if<meta_T::all_attributes, is_odd_attrib >::type q_7;
+ bcout << deref<q_7>::type::base_name() << ',' ;
+ typedef next<q_7>::type q_5;
+ bcout << deref<q_5>::type::base_name() << ',' ;
+ typedef next<q_5>::type q_3;
+ bcout << deref<q_3>::type::base_name() << ',' ;
+ typedef next<q_3>::type q_1;
+ bcout << deref<q_1>::type::base_name() << endl ;
+ typedef next<q_1>::type q_end;
+ //
+ BOOST_STATIC_ASSERT((iterator_equal<
+ rend<meta_T::all_attributes>::type, q_end
+ >::value));
+ */
+ //
+ bcout << "---------------------------------------------------" << endl;
+ //
         typedef find_if<meta_T::all_attributes, is_integral_attrib >::type o_0;
         bcout << deref<o_0>::type::base_name() << ',' ;
         typedef next<o_0>::type o_1;
@@ -169,13 +280,13 @@
         bcout << deref<o_6>::type::base_name() << endl ;
         typedef next<o_6>::type o_end;
         //
- BOOST_STATIC_ASSERT((is_equal_iterator<
+ BOOST_STATIC_ASSERT((iterator_equal<
                 end<meta_T::all_attributes>::type, o_end
>::value));
         //
         bcout << "---------------------------------------------------" << endl;
         //
- BOOST_STATIC_ASSERT((is_equal_iterator<
+ BOOST_STATIC_ASSERT((iterator_equal<
                 begin<meta_T::base_classes>::type,
                 end<meta_T::base_classes>::type
>::value));


Boost-Commit list run by bdawes at acm.org, david.abrahams at rcn.com, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk