|
Boost-Commit : |
Subject: [Boost-commit] svn:boost r50436 - trunk/libs/spirit/example/karma
From: hartmut.kaiser_at_[hidden]
Date: 2009-01-02 05:49:16
Author: hkaiser
Date: 2009-01-02 05:49:15 EST (Fri, 02 Jan 2009)
New Revision: 50436
URL: http://svn.boost.org/trac/boost/changeset/50436
Log:
Spirit.Karma: Fixed Karma examples for very strict compilers
Text files modified:
trunk/libs/spirit/example/karma/basic_facilities.cpp | 1 -
trunk/libs/spirit/example/karma/functor_facilities.cpp | 16 ++++++----------
trunk/libs/spirit/example/karma/quick_start1.cpp | 1 -
3 files changed, 6 insertions(+), 12 deletions(-)
Modified: trunk/libs/spirit/example/karma/basic_facilities.cpp
==============================================================================
--- trunk/libs/spirit/example/karma/basic_facilities.cpp (original)
+++ trunk/libs/spirit/example/karma/basic_facilities.cpp 2009-01-02 05:49:15 EST (Fri, 02 Jan 2009)
@@ -47,7 +47,6 @@
using namespace boost::spirit;
using namespace boost::spirit::ascii;
-namespace karma = boost::spirit::karma;
///////////////////////////////////////////////////////////////////////////////
// Output the given containers in list format
Modified: trunk/libs/spirit/example/karma/functor_facilities.cpp
==============================================================================
--- trunk/libs/spirit/example/karma/functor_facilities.cpp (original)
+++ trunk/libs/spirit/example/karma/functor_facilities.cpp 2009-01-02 05:49:15 EST (Fri, 02 Jan 2009)
@@ -31,13 +31,12 @@
template <typename OutputIterator, typename Context, typename Parameter>
bool operator()(Parameter const&, Context& ctx, OutputIterator& sink) const
{
- namespace karma = boost::spirit::karma;
return karma::generate(sink, int_ << ": ", counter++);
}
-
+
counter_impl(int& counter_)
: counter(counter_) {}
-
+
int& counter;
};
@@ -64,13 +63,12 @@
template <typename OutputIterator, typename Context, typename Parameter>
bool operator()(Parameter const& v, Context& ctx, OutputIterator& sink) const
{
- namespace karma = boost::spirit::karma;
return karma::generate(sink, open << xpr << close, v);
}
-
+
confix_impl(char const* open_, char const* close_, Expr const& xpr_)
: open(open_), close(close_), xpr(xpr_) {}
-
+
std::string open;
std::string close;
Expr xpr;
@@ -98,13 +96,12 @@
template <typename OutputIterator, typename Parameter>
bool operator()(OutputIterator& sink, Parameter const& v) const
{
- namespace karma = boost::spirit::karma;
return karma::generate(sink, xpr % delim, v);
}
-
+
list_impl(Expr const& xpr_, char const* delim_)
: xpr(xpr_), delim(delim_) {}
-
+
Expr xpr;
std::string delim;
};
@@ -131,7 +128,6 @@
///////////////////////////////////////////////////////////////////////////////
int main()
{
- namespace karma = boost::spirit::karma;
using namespace boost::phoenix;
using namespace boost::phoenix::arg_names;
Modified: trunk/libs/spirit/example/karma/quick_start1.cpp
==============================================================================
--- trunk/libs/spirit/example/karma/quick_start1.cpp (original)
+++ trunk/libs/spirit/example/karma/quick_start1.cpp 2009-01-02 05:49:15 EST (Fri, 02 Jan 2009)
@@ -17,7 +17,6 @@
using namespace boost::spirit;
using namespace boost::spirit::ascii;
-namespace karma = boost::spirit::karma;
///////////////////////////////////////////////////////////////////////////////
int main()
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