Boost logo

Boost-Commit :

Subject: [Boost-commit] svn:boost r63680 - in trunk/boost/spirit: home/karma/binary home/karma/operator home/support include
From: hartmut.kaiser_at_[hidden]
Date: 2010-07-05 22:23:24


Author: hkaiser
Date: 2010-07-05 22:23:23 EDT (Mon, 05 Jul 2010)
New Revision: 63680
URL: http://svn.boost.org/trac/boost/changeset/63680

Log:
Spirit: Fixing Karma examples
Added:
   trunk/boost/spirit/include/support_attributes_fwd.hpp (contents, props changed)
Text files modified:
   trunk/boost/spirit/home/karma/binary/padding.hpp | 2 +-
   trunk/boost/spirit/home/karma/operator/sequence.hpp | 7 ++++++-
   trunk/boost/spirit/home/support/attributes.hpp | 3 ---
   trunk/boost/spirit/home/support/attributes_fwd.hpp | 12 ++++++++++++
   4 files changed, 19 insertions(+), 5 deletions(-)

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 2010-07-05 22:23:23 EDT (Mon, 05 Jul 2010)
@@ -75,7 +75,7 @@
 
             bool result = true;
             while (result && count-- != 0)
- result = detail::generate_to(sink, 0);
+ result = detail::generate_to(sink, '\0');
 
             if (result)
                 result = karma::delimit_out(sink, d); // always do post-delimiting

Modified: trunk/boost/spirit/home/karma/operator/sequence.hpp
==============================================================================
--- trunk/boost/spirit/home/karma/operator/sequence.hpp (original)
+++ trunk/boost/spirit/home/karma/operator/sequence.hpp 2010-07-05 22:23:23 EDT (Mon, 05 Jul 2010)
@@ -29,6 +29,8 @@
 #include <boost/type_traits/is_same.hpp>
 #include <boost/mpl/bitor.hpp>
 #include <boost/mpl/int.hpp>
+#include <boost/mpl/and.hpp>
+#include <boost/mpl/not.hpp>
 #include <boost/fusion/include/transform.hpp>
 #include <boost/mpl/accumulate.hpp>
 
@@ -98,7 +100,10 @@
 
         template <typename Attribute>
         inline typename enable_if<
- fusion::traits::is_sequence<Attribute>, std::size_t
+ mpl::and_<
+ fusion::traits::is_sequence<Attribute>
+ , mpl::not_<traits::is_container<Attribute> > >
+ , std::size_t
>::type
         attr_size(Attribute const& attr)
         {

Modified: trunk/boost/spirit/home/support/attributes.hpp
==============================================================================
--- trunk/boost/spirit/home/support/attributes.hpp (original)
+++ trunk/boost/spirit/home/support/attributes.hpp 2010-07-05 22:23:23 EDT (Mon, 05 Jul 2010)
@@ -187,9 +187,6 @@
 
     ///////////////////////////////////////////////////////////////////////////
     // return the type currently stored in the given variant
- template <typename T, typename Enable = void>
- struct variant_which;
-
     template <BOOST_VARIANT_ENUM_PARAMS(typename T)>
     struct variant_which<boost::variant<BOOST_VARIANT_ENUM_PARAMS(T)> >
     {

Modified: trunk/boost/spirit/home/support/attributes_fwd.hpp
==============================================================================
--- trunk/boost/spirit/home/support/attributes_fwd.hpp (original)
+++ trunk/boost/spirit/home/support/attributes_fwd.hpp 2010-07-05 22:23:23 EDT (Mon, 05 Jul 2010)
@@ -107,6 +107,18 @@
     extract_from(Attribute const& attr, Context& ctx);
 
     ///////////////////////////////////////////////////////////////////////////
+ // return the type currently stored in the given variant
+ ///////////////////////////////////////////////////////////////////////////
+ template <typename T, typename Enable = void>
+ struct variant_which;
+
+ ///////////////////////////////////////////////////////////////////////////
+ // Determine, whether T is a variant like type
+ ///////////////////////////////////////////////////////////////////////////
+ template <typename T, typename Domain>
+ struct not_is_variant;
+
+ ///////////////////////////////////////////////////////////////////////////
     // Clear data efficiently
     ///////////////////////////////////////////////////////////////////////////
     template <typename T, typename Enable = void>

Added: trunk/boost/spirit/include/support_attributes_fwd.hpp
==============================================================================
--- (empty file)
+++ trunk/boost/spirit/include/support_attributes_fwd.hpp 2010-07-05 22:23:23 EDT (Mon, 05 Jul 2010)
@@ -0,0 +1,18 @@
+/*=============================================================================
+ Copyright (c) 2001-2010 Joel de Guzman
+ Copyright (c) 2001-2010 Hartmut Kaiser
+ http://spirit.sourceforge.net/
+
+ Distributed under the Boost Software License, Version 1.0. (See accompanying
+ file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
+=============================================================================*/
+#ifndef BOOST_SPIRIT_INCLUDE_SUPPORT_ATTRIBUTE_FWD
+#define BOOST_SPIRIT_INCLUDE_SUPPORT_ATTRIBUTE_FWD
+
+#if defined(_MSC_VER)
+#pragma once
+#endif
+
+#include <boost/spirit/home/support/attributes_fwd.hpp>
+
+#endif


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