|
Boost-Commit : |
Subject: [Boost-commit] svn:boost r52900 - trunk/libs/spirit/example/karma
From: hartmut.kaiser_at_[hidden]
Date: 2009-05-11 08:16:00
Author: hkaiser
Date: 2009-05-11 08:15:59 EDT (Mon, 11 May 2009)
New Revision: 52900
URL: http://svn.boost.org/trac/boost/changeset/52900
Log:
Spirit: applied same fix as for calc2_ast_vm.
Text files modified:
trunk/libs/spirit/example/karma/calc2_ast.hpp | 11 ++++++++---
trunk/libs/spirit/example/karma/calc2_ast_dump.cpp | 6 +++---
trunk/libs/spirit/example/karma/calc2_ast_rpn.cpp | 5 +++--
3 files changed, 14 insertions(+), 8 deletions(-)
Modified: trunk/libs/spirit/example/karma/calc2_ast.hpp
==============================================================================
--- trunk/libs/spirit/example/karma/calc2_ast.hpp (original)
+++ trunk/libs/spirit/example/karma/calc2_ast.hpp 2009-05-11 08:15:59 EDT (Mon, 11 May 2009)
@@ -19,6 +19,7 @@
#define SPIRIT_EXAMPLE_CALC2_AST_APR_30_2008_1011AM
#include <boost/variant.hpp>
+#include <boost/variant/get.hpp>
#include <boost/spirit/include/phoenix_operator.hpp>
#include <boost/spirit/include/phoenix_function.hpp>
#include <boost/spirit/include/phoenix_statement.hpp>
@@ -72,10 +73,14 @@
};
// expose variant functionality
-template <typename T>
-inline T get(expression_ast const& expr)
+namespace boost
{
- return boost::get<T>(expr.expr);
+ // this function has to live in namespace boost for ADL to correctly find it
+ template <typename T>
+ inline T get(expression_ast const& expr)
+ {
+ return boost::get<T>(expr.expr);
+ }
}
///////////////////////////////////////////////////////////////////////////////
Modified: trunk/libs/spirit/example/karma/calc2_ast_dump.cpp
==============================================================================
--- trunk/libs/spirit/example/karma/calc2_ast_dump.cpp (original)
+++ trunk/libs/spirit/example/karma/calc2_ast_dump.cpp 2009-05-11 08:15:59 EDT (Mon, 11 May 2009)
@@ -16,15 +16,15 @@
///////////////////////////////////////////////////////////////////////////////
#include <boost/config/warning_disable.hpp>
-#include <boost/spirit/include/qi.hpp>
-#include <boost/spirit/include/karma.hpp>
-
#include <iostream>
#include <vector>
#include <string>
#include "calc2_ast.hpp"
+#include <boost/spirit/include/qi.hpp>
+#include <boost/spirit/include/karma.hpp>
+
using namespace boost::spirit;
using namespace boost::spirit::ascii;
Modified: trunk/libs/spirit/example/karma/calc2_ast_rpn.cpp
==============================================================================
--- trunk/libs/spirit/example/karma/calc2_ast_rpn.cpp (original)
+++ trunk/libs/spirit/example/karma/calc2_ast_rpn.cpp 2009-05-11 08:15:59 EDT (Mon, 11 May 2009)
@@ -15,8 +15,6 @@
//
///////////////////////////////////////////////////////////////////////////////
#include <boost/config/warning_disable.hpp>
-#include <boost/spirit/include/qi.hpp>
-#include <boost/spirit/include/karma.hpp>
#include <iostream>
#include <vector>
@@ -24,6 +22,9 @@
#include "calc2_ast.hpp"
+#include <boost/spirit/include/qi.hpp>
+#include <boost/spirit/include/karma.hpp>
+
using namespace boost::spirit;
using namespace boost::spirit::ascii;
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