Boost logo

Boost-Commit :

Subject: [Boost-commit] svn:boost r58074 - trunk/boost/spirit/home/karma/detail
From: hartmut.kaiser_at_[hidden]
Date: 2009-11-30 21:36:02


Author: hkaiser
Date: 2009-11-30 21:36:01 EST (Mon, 30 Nov 2009)
New Revision: 58074
URL: http://svn.boost.org/trac/boost/changeset/58074

Log:
Spirit: fixed alternatives for embedded containers of hold_any
Text files modified:
   trunk/boost/spirit/home/karma/detail/alternative_function.hpp | 12 ++++++++++--
   1 files changed, 10 insertions(+), 2 deletions(-)

Modified: trunk/boost/spirit/home/karma/detail/alternative_function.hpp
==============================================================================
--- trunk/boost/spirit/home/karma/detail/alternative_function.hpp (original)
+++ trunk/boost/spirit/home/karma/detail/alternative_function.hpp 2009-11-30 21:36:01 EST (Mon, 30 Nov 2009)
@@ -42,11 +42,19 @@
     struct attribute_is_compatible<Expected, boost::optional<Attribute> >
       : is_convertible<Attribute, Expected> {};
 
+ template <typename Container>
+ struct is_hold_any_container
+ : mpl::and_<
+ traits::is_container<Container>
+ , is_same<hold_any, typename traits::container_value<Container>::type>
+ > {};
+
     template <typename Expected, typename Attribute, typename IsNotVariant>
     struct compute_compatible_component_variant
       : mpl::or_<
- attribute_is_compatible<Expected, Attribute>
- , is_same<hold_any, Expected> > {};
+ attribute_is_compatible<Expected, Attribute>
+ , is_same<hold_any, Expected>
+ , is_hold_any_container<Expected> > {};
 
     template <typename Expected, typename Attribute>
     struct compute_compatible_component_variant<Expected, Attribute, mpl::false_>


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