Boost logo

Boost-Commit :

Subject: [Boost-commit] svn:boost r53610 - trunk/boost/spirit/home/karma/detail
From: hartmut.kaiser_at_[hidden]
Date: 2009-06-03 18:42:10


Author: hkaiser
Date: 2009-06-03 18:42:10 EDT (Wed, 03 Jun 2009)
New Revision: 53610
URL: http://svn.boost.org/trac/boost/changeset/53610

Log:
Spirit: fixed another problem in attribute handling for Karma sequences taking a std vector as its attribute
Text files modified:
   trunk/boost/spirit/home/karma/detail/pass_container.hpp | 54 +++++++++++++++++++--------------------
   1 files changed, 26 insertions(+), 28 deletions(-)

Modified: trunk/boost/spirit/home/karma/detail/pass_container.hpp
==============================================================================
--- trunk/boost/spirit/home/karma/detail/pass_container.hpp (original)
+++ trunk/boost/spirit/home/karma/detail/pass_container.hpp 2009-06-03 18:42:10 EDT (Wed, 03 Jun 2009)
@@ -42,11 +42,10 @@
 
     template <typename RHS, typename T>
     struct has_same_elements<RHS, optional<T>, true>
- : mpl::or_<is_convertible<T, RHS>, is_same<T, hold_any> > {};
+ : has_same_elements<RHS, T> {};
 
 #define BOOST_SPIRIT_IS_CONVERTIBLE(z, N, data) \
- is_convertible<BOOST_PP_CAT(T, N), RHS>::value || \
- is_same<BOOST_PP_CAT(T, N), hold_any>::value || \
+ has_same_elements<RHS, BOOST_PP_CAT(T, N)>::value || \
     /***/
 
     // Note: variants are treated as containers if one of the held types is a
@@ -87,32 +86,31 @@
             return true;
         }
 
- // this is for the case when the current element expects an attribute
- // which is a container itself, this element will get the rest of the
- // attribute container
- template <typename Component>
- bool dispatch_attribute_element(Component const& component, mpl::true_) const
- {
-// bool result = f(component, container_type(iter, traits::end(attr)));
- bool result = f(component, make_iterator_range(iter, traits::end(attr)));
- if (result)
- iter = traits::end(attr); // adjust current iter to the end
- return result;
- }
-
- // This handles the distinction between elements in a sequence expecting
- // containers themselves and elements expecting non-containers as their
- // attribute. Note: is_container treats optional<T>, where T is a
- // container as a container as well.
- template <typename Component>
- bool dispatch_attribute(Component const& component, mpl::true_) const
- {
- typedef traits::is_container<
- typename traits::attribute_of<Component, context_type>::type
- > predicate;
+ // this is for the case when the current element expects an attribute
+ // which is a container itself, this element will get the rest of the
+ // attribute container
+ template <typename Component>
+ bool dispatch_attribute_element(Component const& component, mpl::true_) const
+ {
+ bool result = f(component, make_iterator_range(iter, traits::end(attr)));
+ if (result)
+ iter = traits::end(attr); // adjust current iter to the end
+ return result;
+ }
+
+ // This handles the distinction between elements in a sequence expecting
+ // containers themselves and elements expecting non-containers as their
+ // attribute. Note: is_container treats optional<T>, where T is a
+ // container as a container as well.
+ template <typename Component>
+ bool dispatch_attribute(Component const& component, mpl::true_) const
+ {
+ typedef traits::is_container<
+ typename traits::attribute_of<Component, context_type>::type
+ > predicate;
 
- return dispatch_attribute_element(component, predicate());
- }
+ return dispatch_attribute_element(component, predicate());
+ }
 
         // this is for the case when the current element doesn't expect an
         // attribute


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