Boost logo

Boost-Commit :

Subject: [Boost-commit] svn:boost r57736 - trunk/libs/spirit/example/qi
From: joel_at_[hidden]
Date: 2009-11-17 21:30:29


Author: djowel
Date: 2009-11-17 21:30:28 EST (Tue, 17 Nov 2009)
New Revision: 57736
URL: http://svn.boost.org/trac/boost/changeset/57736

Log:
BOOST_SPIRIT_AUTO added
Text files modified:
   trunk/libs/spirit/example/qi/typeof.cpp | 11 ++++++++++-
   1 files changed, 10 insertions(+), 1 deletions(-)

Modified: trunk/libs/spirit/example/qi/typeof.cpp
==============================================================================
--- trunk/libs/spirit/example/qi/typeof.cpp (original)
+++ trunk/libs/spirit/example/qi/typeof.cpp 2009-11-17 21:30:28 EST (Tue, 17 Nov 2009)
@@ -13,6 +13,15 @@
 ///////////////////////////////////////////////////////////////////////////////
 // Main program
 ///////////////////////////////////////////////////////////////////////////////
+
+#define BOOST_SPIRIT_AUTO(domain_, name, expr) \
+ typedef BOOST_TYPEOF(expr) name##expr_type; \
+ BOOST_SPIRIT_ASSERT_MATCH(boost::spirit::domain_::domain, name##expr_type); \
+ boost::spirit::result_of::compile< \
+ boost::spirit::domain_::domain, name##expr_type>::type \
+ name = boost::spirit::compile<boost::spirit::domain_::domain>(expr); \
+ //
+
 int
 main()
 {
@@ -21,7 +30,7 @@
     using boost::spirit::qi::parse;
     typedef std::string::const_iterator iterator_type;
     
- BOOST_AUTO(comment, "/*" >> *(char_ - "*/") >> "*/");
+ BOOST_SPIRIT_AUTO(qi, comment, "/*" >> *(char_ - "*/") >> "*/");
 
     std::string str = "/*This is a comment*/";
     std::string::const_iterator iter = str.begin();


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