|
Boost-Commit : |
Subject: [Boost-commit] svn:boost r57107 - trunk/libs/spirit/test/qi
From: joel_at_[hidden]
Date: 2009-10-23 12:27:56
Author: djowel
Date: 2009-10-23 12:27:55 EDT (Fri, 23 Oct 2009)
New Revision: 57107
URL: http://svn.boost.org/trac/boost/changeset/57107
Log:
alternatives with optional attributes
Text files modified:
trunk/libs/spirit/test/qi/alternative.cpp | 10 ++++++----
1 files changed, 6 insertions(+), 4 deletions(-)
Modified: trunk/libs/spirit/test/qi/alternative.cpp
==============================================================================
--- trunk/libs/spirit/test/qi/alternative.cpp (original)
+++ trunk/libs/spirit/test/qi/alternative.cpp 2009-10-23 12:27:55 EDT (Fri, 23 Oct 2009)
@@ -112,11 +112,13 @@
{ // test action
- namespace phoenix = boost::phoenix;
- boost::variant<unused_type, int, char> v;
+ namespace phx = boost::phoenix;
+ boost::optional<boost::variant<int, char> > v;
- BOOST_TEST((test("12345", (lit("rock") | int_ | char_)[phoenix::ref(v) = _1])));
- BOOST_TEST(boost::get<int>(v) == 12345);
+ BOOST_TEST((test("12345", (lit("rock") | int_ | char_)[phx::ref(v) = _1])));
+ BOOST_TEST(boost::get<int>(boost::get(v)) == 12345);
+ BOOST_TEST((test("rock", (lit("rock") | int_ | char_)[phx::ref(v) = _1])));
+ BOOST_TEST(!v);
}
{
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