Boost logo

Boost-Commit :

Subject: [Boost-commit] svn:boost r50069 - in sandbox/mirror: boost/mirror/detail boost/mirror/iterator/detail libs/mirror/example/algorithms libs/mirror/test
From: chochlik_at_[hidden]
Date: 2008-12-02 08:24:11


Author: matus.chochlik
Date: 2008-12-02 08:24:11 EST (Tue, 02 Dec 2008)
New Revision: 50069
URL: http://svn.boost.org/trac/boost/changeset/50069

Log:
[mirror 0.3.x]
- bugfixes
Text files modified:
   sandbox/mirror/boost/mirror/detail/argument_type_list.hpp | 5 ++
   sandbox/mirror/boost/mirror/iterator/detail/common_iterator.hpp | 89 ++++++++++++++++++++++++++++++++++++---
   sandbox/mirror/libs/mirror/example/algorithms/begin_end.cpp | 5 +
   sandbox/mirror/libs/mirror/test/types.hpp | 8 +-
   4 files changed, 93 insertions(+), 14 deletions(-)

Modified: sandbox/mirror/boost/mirror/detail/argument_type_list.hpp
==============================================================================
--- sandbox/mirror/boost/mirror/detail/argument_type_list.hpp (original)
+++ sandbox/mirror/boost/mirror/detail/argument_type_list.hpp 2008-12-02 08:24:11 EST (Tue, 02 Dec 2008)
@@ -31,6 +31,11 @@
 template <typename T>
 struct is_typelist_null_type : ::boost::false_type { };
 
+// mpl::void_ is a type_list null type
+template <>
+struct is_typelist_null_type< ::boost::mpl::void_ >
+ : ::boost::true_type { };
+
 template <typename ArgTypeList>
 struct template_args_type_list_wo_nulls
 {

Modified: sandbox/mirror/boost/mirror/iterator/detail/common_iterator.hpp
==============================================================================
--- sandbox/mirror/boost/mirror/iterator/detail/common_iterator.hpp (original)
+++ sandbox/mirror/boost/mirror/iterator/detail/common_iterator.hpp 2008-12-02 08:24:11 EST (Tue, 02 Dec 2008)
@@ -36,6 +36,13 @@
 
 namespace detail {
 
+ /** This is the declaration of the base iterator template.
+ * Every iterator knows the reflected type and the variant,
+ * the meta-objec-sequence and the current position,
+ * the beginning position and the end position,
+ * the direction of the iteraton, an unary predicate
+ * and a meta-object selector
+ */
         template <
                 class ReflectedType,
                 class VariantTag,
@@ -49,12 +56,15 @@
>
         struct meta_object_iterator_base_templ;
 
+ /** This allows to get the initial or the next iterator.
+ */
         template <
                 class ReflectedType,
                 class VariantTag,
                 class MetaObjectSequence,
- class DummyPosition,
+ class CurrentPosition,
                 class BeginPos,
+ class BeforeEndPos,
                 class EndPos,
                 class Direction,
                 class UnaryPredicate,
@@ -68,7 +78,7 @@
                         VariantTag,
                         MetaObjectSequence,
                         typename mpl::int_<mpl::plus<
- DummyPosition,
+ CurrentPosition,
                                 mpl::times<
                                         Direction,
                                         mpl::int_<I>
@@ -97,11 +107,62 @@
> ::type type;
         };
 
+
+ template <
+ class ReflectedType,
+ class VariantTag,
+ class MetaObjectSequence,
+ class BeginPos,
+ class BeforeEndPos,
+ class EndPos,
+ class Direction,
+ class UnaryPredicate,
+ class Selector,
+ int I
+ >
+ struct meta_object_iterator_base_templ_get_ioni_apply<
+ ReflectedType,
+ VariantTag,
+ MetaObjectSequence,
+ BeforeEndPos,
+ BeginPos,
+ BeforeEndPos,
+ EndPos,
+ Direction,
+ UnaryPredicate,
+ Selector,
+ I
+ >
+ {
+ /** if we are on the last element right before end
+ * don't apply the predicate on the result of the
+ * next iterator.
+ */
+ typedef meta_object_iterator_base_templ<
+ ReflectedType,
+ VariantTag,
+ MetaObjectSequence,
+ typename mpl::int_<mpl::plus<
+ BeforeEndPos,
+ mpl::times<
+ Direction,
+ mpl::int_<I>
+ >
+ >::value>,
+ BeginPos,
+ EndPos,
+ Direction,
+ UnaryPredicate,
+ Selector
+ > type;
+ };
+
         template <
                 class ReflectedType,
                 class VariantTag,
                 class MetaObjectSequence,
                 class BeginPos,
+ class BeforeEndPos,
                 class EndPos,
                 class Direction,
                 class UnaryPredicate,
@@ -114,6 +175,7 @@
                 MetaObjectSequence,
                 EndPos,
                 BeginPos,
+ BeforeEndPos,
                 EndPos,
                 Direction,
                 UnaryPredicate,
@@ -179,14 +241,14 @@
                 // the current iterator getter
                 struct get_this_iterator
                 {
- template <typename DummyPosition>
+ template <typename CurrentPosition>
                         struct apply
                         {
                                 typedef meta_object_iterator_base_templ<
                                         ReflectedType,
                                         VariantTag,
                                         MetaObjectSequence,
- DummyPosition,
+ CurrentPosition,
                                         BeginPos,
                                         EndPos,
                                         Direction,
@@ -199,7 +261,7 @@
                 // the prior iterator getter
                 struct get_prior_iterator
                 {
- template <typename DummyPosition>
+ template <typename CurrentPosition>
                         struct apply
                         {
                                 typedef meta_object_iterator_base_templ<
@@ -207,7 +269,7 @@
                                         VariantTag,
                                         MetaObjectSequence,
                                         typename mpl::int_<mpl::minus<
- DummyPosition,
+ CurrentPosition,
                                                 mpl::times<
                                                         Direction,
                                                         mpl::int_<1>
@@ -227,14 +289,25 @@
                 template <int I>
                 struct get_initial_or_next_iterator
                 {
+ typedef typename mpl::int_<
+ mpl::minus<
+ EndPos,
+ mpl::times<
+ Direction,
+ mpl::int_<1>
+ >
+ >::value
+ >::type before_end_pos;
+
 
- template <typename DummyPosition>
+ template <typename CurrentPosition>
                         struct apply : meta_object_iterator_base_templ_get_ioni_apply<
                                 ReflectedType,
                                 VariantTag,
                                 MetaObjectSequence,
- DummyPosition,
+ CurrentPosition,
                                 BeginPos,
+ before_end_pos,
                                 EndPos,
                                 Direction,
                                 UnaryPredicate,

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-12-02 08:24:11 EST (Tue, 02 Dec 2008)
@@ -49,10 +49,11 @@
 
 struct is_integral_attrib
 {
-
         template <class MetaAttribute>
         struct apply : is_integral<
- typename MetaAttribute::type
+ typename MetaAttribute::
+ type::
+ reflected_type
>::type { };
 };
 

Modified: sandbox/mirror/libs/mirror/test/types.hpp
==============================================================================
--- sandbox/mirror/libs/mirror/test/types.hpp (original)
+++ sandbox/mirror/libs/mirror/test/types.hpp 2008-12-02 08:24:11 EST (Tue, 02 Dec 2008)
@@ -19,22 +19,22 @@
 namespace feature {
 namespace detail {
 
-struct foo_impl;
+struct foo_impl { };
 
 } // namespace detail
 
-struct foo;
+struct foo { };
 
 } // namespace feature
 
-struct bar;
+struct bar { };
 
 typedef feature::foo foobar;
 
 } // namespace test
 
 // type on the global scope
-struct baz;
+struct baz { };
 
 namespace boost {
 namespace mirror {


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