Boost logo

Boost-Commit :

From: hartmut.kaiser_at_[hidden]
Date: 2008-07-11 13:10:59


Author: hkaiser
Date: 2008-07-11 13:10:58 EDT (Fri, 11 Jul 2008)
New Revision: 47315
URL: http://svn.boost.org/trac/boost/changeset/47315

Log:
Spirit: Fixing some of the regressions in Karma
Text files modified:
   trunk/boost/spirit/home/karma/auxiliary/eol.hpp | 1 +
   trunk/boost/spirit/home/karma/binary/padding.hpp | 2 ++
   trunk/boost/spirit/home/karma/operator/detail/alternative.hpp | 19 +++++++------------
   trunk/boost/spirit/home/support/detail/hold_any.hpp | 2 +-
   trunk/libs/spirit/example/karma/actions.cpp | 2 +-
   trunk/libs/spirit/test/karma/actions.cpp | 2 +-
   trunk/libs/spirit/test/karma/test.hpp | 8 ++++++++
   7 files changed, 21 insertions(+), 15 deletions(-)

Modified: trunk/boost/spirit/home/karma/auxiliary/eol.hpp
==============================================================================
--- trunk/boost/spirit/home/karma/auxiliary/eol.hpp (original)
+++ trunk/boost/spirit/home/karma/auxiliary/eol.hpp 2008-07-11 13:10:58 EDT (Fri, 11 Jul 2008)
@@ -9,6 +9,7 @@
 #include <boost/spirit/home/karma/domain.hpp>
 #include <boost/spirit/home/karma/delimit.hpp>
 #include <boost/spirit/home/support/unused.hpp>
+#include <boost/spirit/home/karma/detail/generate_to.hpp>
 
 namespace boost { namespace spirit { namespace karma
 {

Modified: trunk/boost/spirit/home/karma/binary/padding.hpp
==============================================================================
--- trunk/boost/spirit/home/karma/binary/padding.hpp (original)
+++ trunk/boost/spirit/home/karma/binary/padding.hpp 2008-07-11 13:10:58 EDT (Fri, 11 Jul 2008)
@@ -6,6 +6,8 @@
 #if !defined(BOOST_SPIRIT_KARMA_PADDING_MAY_06_2008_0436PM)
 #define BOOST_SPIRIT_KARMA_PADDING_MAY_06_2008_0436PM
 
+#include <boost/lexical_cast.hpp>
+
 #include <boost/spirit/home/karma/domain.hpp>
 #include <boost/spirit/home/karma/delimit.hpp>
 #include <boost/spirit/home/support/unused.hpp>

Modified: trunk/boost/spirit/home/karma/operator/detail/alternative.hpp
==============================================================================
--- trunk/boost/spirit/home/karma/operator/detail/alternative.hpp (original)
+++ trunk/boost/spirit/home/karma/operator/detail/alternative.hpp 2008-07-11 13:10:58 EDT (Fri, 11 Jul 2008)
@@ -41,16 +41,11 @@
         typedef typename mpl::begin<types>::type begin;
 
         typedef typename
- mpl::find_if<
- types,
- is_convertible<mpl::_1, Expected>
- >::type
+ mpl::find_if<types, is_same<mpl::_1, Expected> >::type
         iter;
 
         typedef typename mpl::not_<is_same<iter, end> >::type type;
         enum { value = type::value };
-
-
     };
 
     template <typename Expected>
@@ -117,18 +112,18 @@
     {
         // If this alternative is a sequence, we wrap the attribute into a
         // fusion sequence.
- template <typename Parameter>
- static fusion::vector<Parameter const&>
- wrap_attribute(Parameter const& param, mpl::true_)
+ template <typename Parameter_>
+ static fusion::vector<Parameter_ const&>
+ wrap_attribute(Parameter_ const& param, mpl::true_)
         {
             return fusion::vector<Parameter const&>(param);
         }
 
         // If this alternative is not a sequence the parameter is passed
         // through unchanged.
- template <typename Parameter>
- static Parameter const&
- wrap_attribute(Parameter const& param, mpl::false_)
+ template <typename Parameter_>
+ static Parameter_ const&
+ wrap_attribute(Parameter_ const& param, mpl::false_)
         {
             return param;
         }

Modified: trunk/boost/spirit/home/support/detail/hold_any.hpp
==============================================================================
--- trunk/boost/spirit/home/support/detail/hold_any.hpp (original)
+++ trunk/boost/spirit/home/support/detail/hold_any.hpp 2008-07-11 13:10:58 EDT (Fri, 11 Jul 2008)
@@ -43,7 +43,7 @@
           : from(src.name()), to(dest.name())
         {}
 
- virtual const char* what() throw() { return "bad any cast"; }
+ virtual const char* what() const throw() { return "bad any cast"; }
 
         const char* from;
         const char* to;

Modified: trunk/libs/spirit/example/karma/actions.cpp
==============================================================================
--- trunk/libs/spirit/example/karma/actions.cpp (original)
+++ trunk/libs/spirit/example/karma/actions.cpp 2008-07-11 13:10:58 EDT (Fri, 11 Jul 2008)
@@ -12,7 +12,7 @@
 #include <boost/bind.hpp>
 
 #include <iostream>
-#include <strstream>
+#include <sstream>
 
 // Presented are various ways to attach semantic actions
 // * Using plain function pointer

Modified: trunk/libs/spirit/test/karma/actions.cpp
==============================================================================
--- trunk/libs/spirit/test/karma/actions.cpp (original)
+++ trunk/libs/spirit/test/karma/actions.cpp 2008-07-11 13:10:58 EDT (Fri, 11 Jul 2008)
@@ -14,7 +14,7 @@
 #include <boost/bind.hpp>
 #include <boost/function_output_iterator.hpp>
 
-#include <strstream>
+#include <sstream>
 #include "test.hpp"
 
 using namespace spirit_test;

Modified: trunk/libs/spirit/test/karma/test.hpp
==============================================================================
--- trunk/libs/spirit/test/karma/test.hpp (original)
+++ trunk/libs/spirit/test/karma/test.hpp 2008-07-11 13:10:58 EDT (Fri, 11 Jul 2008)
@@ -36,6 +36,14 @@
     display_type const display = {};
 
     ///////////////////////////////////////////////////////////////////////////
+ template <typename Char>
+ struct output_iterator
+ {
+ typedef std::basic_string<Char> string_type;
+ typedef std::back_insert_iterator<string_type> type;
+ };
+
+ ///////////////////////////////////////////////////////////////////////////
     template <typename Char, typename Generator>
     inline bool test(Char const *expected, Generator const& g)
     {


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