|
Boost-Commit : |
From: joel_at_[hidden]
Date: 2008-04-18 07:12:14
Author: djowel
Date: 2008-04-18 07:12:14 EDT (Fri, 18 Apr 2008)
New Revision: 44539
URL: http://svn.boost.org/trac/boost/changeset/44539
Log:
tweaks
Text files modified:
trunk/libs/spirit/example/karma/actions.cpp | 32 ++++++++++++++++----------------
1 files changed, 16 insertions(+), 16 deletions(-)
Modified: trunk/libs/spirit/example/karma/actions.cpp
==============================================================================
--- trunk/libs/spirit/example/karma/actions.cpp (original)
+++ trunk/libs/spirit/example/karma/actions.cpp 2008-04-18 07:12:14 EDT (Fri, 18 Apr 2008)
@@ -15,10 +15,10 @@
#include <boost/function_output_iterator.hpp>
// Presented are various ways to attach semantic actions
-// * Using plain function pointers
-// * Using plain simple function objects
-// * Using plain boost.bind
-// * Using plain boost.lambda
+// * Using plain function pointer
+// * Using simple function object
+// * Using boost.bind
+// * Using boost.lambda
using namespace boost::spirit;
@@ -37,14 +37,14 @@
///////////////////////////////////////////////////////////////////////////
template <typename String>
-struct string_appender
+struct string_appender
{
- string_appender(String& s)
- : str(s)
+ string_appender(String& s)
+ : str(s)
{}
-
+
template <typename T>
- void operator()(T const &x) const
+ void operator()(T const &x) const
{
str += x;
}
@@ -53,7 +53,7 @@
};
template <typename String>
-inline string_appender<String>
+inline string_appender<String>
make_string_appender(String& str)
{
return string_appender<String>(str);
@@ -68,7 +68,7 @@
{ // example using plain functions
std::string generated;
bool result = karma::generate(
- make_function_output_iterator(make_string_appender(generated)),
+ make_function_output_iterator(make_string_appender(generated)),
'{' << int_[&read] << '}');
if (result)
@@ -78,7 +78,7 @@
{ // example using simple function objects
std::string generated;
bool result = karma::generate(
- make_function_output_iterator(make_string_appender(generated)),
+ make_function_output_iterator(make_string_appender(generated)),
'{' << int_[read_action()] << '}');
if (result)
@@ -88,7 +88,7 @@
{ // example using boost.bind
std::string generated;
bool result = karma::generate(
- make_function_output_iterator(make_string_appender(generated)),
+ make_function_output_iterator(make_string_appender(generated)),
'{' << int_[boost::bind(&read, _1)] << '}');
if (result)
@@ -100,15 +100,15 @@
std::string generated;
std::stringstream strm("42");
-
+
bool result = karma::generate(
- make_function_output_iterator(make_string_appender(generated)),
+ make_function_output_iterator(make_string_appender(generated)),
'{' << int_[strm >> _1] << '}');
if (result)
std::cout << "Boost.Lambda: " << generated << std::endl;
}
-
+
return 0;
}
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