Boost logo

Boost-Commit :

Subject: [Boost-commit] svn:boost r81910 - trunk/boost/spirit/home/support
From: hartmut.kaiser_at_[hidden]
Date: 2012-12-13 14:22:53


Author: hkaiser
Date: 2012-12-13 14:22:53 EST (Thu, 13 Dec 2012)
New Revision: 81910
URL: http://svn.boost.org/trac/boost/changeset/81910

Log:
Spirit: another attempt to fix the sequence compilation problem in Karma when variants are involved
Text files modified:
   trunk/boost/spirit/home/support/attributes.hpp | 14 +++++++++++---
   1 files changed, 11 insertions(+), 3 deletions(-)

Modified: trunk/boost/spirit/home/support/attributes.hpp
==============================================================================
--- trunk/boost/spirit/home/support/attributes.hpp (original)
+++ trunk/boost/spirit/home/support/attributes.hpp 2012-12-13 14:22:53 EST (Thu, 13 Dec 2012)
@@ -524,11 +524,17 @@
     {
         struct attribute_size_visitor : static_visitor<>
         {
+ attribute_size_visitor(std::size_t& size)
+ :size_(size)
+ {}
+
             template <typename T>
- typename attribute_size<T>::type operator()(T const& val) const
+ typename void operator()(T const& val)
             {
- return spirit::traits::size(val);
+ size_ = spirit::traits::size(val);
             }
+
+ std::size_t& size_;
         };
     }
 
@@ -539,7 +545,9 @@
 
         static std::size_t call(variant<BOOST_VARIANT_ENUM_PARAMS(T)> const& val)
         {
- return apply_visitor(detail::attribute_size_visitor(), val);
+ std::size_t size = 0;
+ apply_visitor(detail::attribute_size_visitor(size), val);
+ return size;
         }
     };
 


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