|
Boost-Commit : |
Subject: [Boost-commit] svn:boost r69811 - trunk/boost/spirit/home/qi/detail
From: joel_at_[hidden]
Date: 2011-03-09 19:39:22
Author: djowel
Date: 2011-03-09 19:39:17 EST (Wed, 09 Mar 2011)
New Revision: 69811
URL: http://svn.boost.org/trac/boost/changeset/69811
Log:
fixes bug_march_10_2011_8_35_am in alternative.cpp test
Text files modified:
trunk/boost/spirit/home/qi/detail/alternative_function.hpp | 23 ++++++++++++++++++++++-
1 files changed, 22 insertions(+), 1 deletions(-)
Modified: trunk/boost/spirit/home/qi/detail/alternative_function.hpp
==============================================================================
--- trunk/boost/spirit/home/qi/detail/alternative_function.hpp (original)
+++ trunk/boost/spirit/home/qi/detail/alternative_function.hpp 2011-03-09 19:39:17 EST (Wed, 09 Mar 2011)
@@ -87,7 +87,7 @@
}
template <typename Component>
- bool call_optional_or_variant(Component const& component, mpl::false_) const
+ bool call_variant(Component const& component, mpl::false_) const
{
// If Attribute is a variant, then search the variant types for a
// suitable substitute type.
@@ -107,6 +107,27 @@
}
template <typename Component>
+ bool call_variant(Component const& component, mpl::true_) const
+ {
+ // If Attribute is a variant and the expected attribute is
+ // the same type (pass the variant as-is).
+
+ return component.parse(first, last, context, skipper, attr);
+ }
+
+ template <typename Component>
+ bool call_optional_or_variant(Component const& component, mpl::false_) const
+ {
+ // Attribute is a variant...
+
+ typedef typename
+ traits::attribute_of<Component, Context, Iterator>::type
+ expected;
+ return call_variant(component,
+ is_same<Attribute, expected>());
+ }
+
+ template <typename Component>
bool call(Component const& component, mpl::false_) const
{
return call_optional_or_variant(
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