|
Boost-Commit : |
Subject: [Boost-commit] svn:boost r56566 - trunk/boost/spirit/home/qi/operator
From: joel_at_[hidden]
Date: 2009-10-04 01:07:07
Author: djowel
Date: 2009-10-04 01:07:07 EDT (Sun, 04 Oct 2009)
New Revision: 56566
URL: http://svn.boost.org/trac/boost/changeset/56566
Log:
Tweaks for recursive_wrapper
Text files modified:
trunk/boost/spirit/home/qi/operator/alternative.hpp | 14 ++++++++++++--
1 files changed, 12 insertions(+), 2 deletions(-)
Modified: trunk/boost/spirit/home/qi/operator/alternative.hpp
==============================================================================
--- trunk/boost/spirit/home/qi/operator/alternative.hpp (original)
+++ trunk/boost/spirit/home/qi/operator/alternative.hpp 2009-10-04 01:07:07 EDT (Sun, 04 Oct 2009)
@@ -40,11 +40,19 @@
namespace boost { namespace spirit { namespace qi
{
namespace detail
- {
+ {
+ template <typename T>
+ struct get_variant_element
+ : mpl::identity<T> {};
+
+ template <typename T>
+ struct get_variant_element<recursive_wrapper<T> >
+ : mpl::identity<T> {};
+
template <typename T>
struct get_variant_types;
-#define BOOST_SPIRIT_IDENTITY(z, n, data) mpl::identity<BOOST_PP_CAT(T, n)>
+#define BOOST_SPIRIT_IDENTITY(z, n, data) get_variant_element<BOOST_PP_CAT(T, n)>
template <BOOST_VARIANT_ENUM_PARAMS(typename T)>
struct get_variant_types<variant<BOOST_VARIANT_ENUM_PARAMS(T)> >
{
@@ -86,6 +94,7 @@
, Context& context, Skipper const& skipper
, Attribute& attr, mpl::true_) const
{
+ // This branch is chosen if attr *is not* a variant
detail::alternative_function<Iterator, Context, Skipper, Attribute>
f(first, last, context, skipper, attr);
@@ -99,6 +108,7 @@
, Context& context, Skipper const& skipper
, Attribute& attr, mpl::false_) const
{
+ // This branch is chosen if attr *is* a variant
detail::alternative_function<Iterator, Context, Skipper, Attribute>
f(first, last, context, skipper, attr);
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