Boost logo

Boost-Commit :

Subject: [Boost-commit] svn:boost r81797 - in branches/release: . boost boost/spirit boost/spirit/home boost/spirit/home/classic/iterator boost/spirit/home/karma boost/spirit/home/karma/detail boost/spirit/home/karma/numeric/detail boost/spirit/home/karma/operator boost/spirit/home/support libs libs/spirit libs/spirit/classic/doc libs/spirit/doc libs/spirit/doc/karma libs/spirit/example libs/spirit/example/qi/compiler_tutorial/calc7 libs/spirit/example/qi/compiler_tutorial/calc8 libs/spirit/example/qi/compiler_tutorial/conjure1 libs/spirit/example/qi/compiler_tutorial/conjure2 libs/spirit/example/qi/compiler_tutorial/mini_c libs/spirit/test libs/spirit/test/karma libs/spirit/test/qi libs/spirit/test/support
From: hartmut.kaiser_at_[hidden]
Date: 2012-12-08 11:31:19


Author: hkaiser
Date: 2012-12-08 11:31:17 EST (Sat, 08 Dec 2012)
New Revision: 81797
URL: http://svn.boost.org/trac/boost/changeset/81797

Log:
Spirit: merging from trunk
Added:
   branches/release/libs/spirit/test/karma/regression_container_variant_sequence.cpp
      - copied unchanged from r76463, /trunk/libs/spirit/test/karma/regression_container_variant_sequence.cpp
   branches/release/libs/spirit/test/karma/regression_real_0.cpp
      - copied unchanged from r81161, /trunk/libs/spirit/test/karma/regression_real_0.cpp
   branches/release/libs/spirit/test/karma/regression_unicode_char.cpp
      - copied unchanged from r81746, /trunk/libs/spirit/test/karma/regression_unicode_char.cpp
Properties modified:
   branches/release/ (props changed)
   branches/release/boost/ (props changed)
   branches/release/boost/spirit/ (props changed)
   branches/release/boost/spirit/home/ (props changed)
   branches/release/boost/spirit/home/karma/ (props changed)
   branches/release/boost/spirit/home/support/attributes.hpp (contents, props changed)
   branches/release/libs/ (props changed)
   branches/release/libs/spirit/ (props changed)
   branches/release/libs/spirit/doc/ (props changed)
   branches/release/libs/spirit/example/ (props changed)
   branches/release/libs/spirit/example/qi/compiler_tutorial/conjure2/ (props changed)
   branches/release/libs/spirit/test/ (props changed)
Text files modified:
   branches/release/boost/spirit/home/classic/iterator/multi_pass.hpp | 8 +-
   branches/release/boost/spirit/home/karma.hpp | 4
   branches/release/boost/spirit/home/karma/detail/output_iterator.hpp | 42 +++++++---
   branches/release/boost/spirit/home/karma/numeric/detail/numeric_utils.hpp | 158 ++++++++++++++++++++-------------------
   branches/release/boost/spirit/home/karma/numeric/detail/real_utils.hpp | 4
   branches/release/boost/spirit/home/karma/operator/list.hpp | 32 ++++----
   branches/release/boost/spirit/home/support/attributes.hpp | 25 ++++++
   branches/release/libs/spirit/classic/doc/multi_pass.html | 2
   branches/release/libs/spirit/doc/karma/numeric.qbk | 3
   branches/release/libs/spirit/doc/what_s_new.qbk | 4
   branches/release/libs/spirit/example/qi/compiler_tutorial/calc7/compiler.hpp | 2
   branches/release/libs/spirit/example/qi/compiler_tutorial/calc8/compiler.hpp | 2
   branches/release/libs/spirit/example/qi/compiler_tutorial/conjure1/compiler.hpp | 2
   branches/release/libs/spirit/example/qi/compiler_tutorial/conjure2/compiler.hpp | 2
   branches/release/libs/spirit/example/qi/compiler_tutorial/mini_c/compiler.hpp | 2
   branches/release/libs/spirit/test/Jamfile | 3
   branches/release/libs/spirit/test/qi/alternative.cpp | 4
   branches/release/libs/spirit/test/qi/uint_radix.hpp | 2
   branches/release/libs/spirit/test/support/utree.cpp | 4
   19 files changed, 175 insertions(+), 130 deletions(-)

Modified: branches/release/boost/spirit/home/classic/iterator/multi_pass.hpp
==============================================================================
--- branches/release/boost/spirit/home/classic/iterator/multi_pass.hpp (original)
+++ branches/release/boost/spirit/home/classic/iterator/multi_pass.hpp 2012-12-08 11:31:17 EST (Sat, 08 Dec 2012)
@@ -194,7 +194,7 @@
         }
 
         // called to verify that everything is okay.
- void check() const
+ void check_if_valid() const
         {
             if (buf_id != *shared_buf_id)
             {
@@ -226,7 +226,7 @@
         no_check(no_check const&) {}
         void destroy() {}
         void swap(no_check&) {}
- void check() const {}
+ void check_if_valid() const {}
         void clear_queue() {}
 };
 
@@ -1000,7 +1000,7 @@
 multi_pass<InputT, InputPolicy, OwnershipPolicy, CheckingPolicy, StoragePolicy>::
 operator*() const
 {
- CHP::check();
+ CHP::check_if_valid();
     return SP::dereference(*this);
 }
 
@@ -1034,7 +1034,7 @@
 multi_pass<InputT, InputPolicy, OwnershipPolicy, CheckingPolicy, StoragePolicy>::
 operator++()
 {
- CHP::check();
+ CHP::check_if_valid();
     SP::increment(*this);
     return *this;
 }

Modified: branches/release/boost/spirit/home/karma.hpp
==============================================================================
--- branches/release/boost/spirit/home/karma.hpp (original)
+++ branches/release/boost/spirit/home/karma.hpp 2012-12-08 11:31:17 EST (Sat, 08 Dec 2012)
@@ -1,6 +1,6 @@
 // Copyright (c) 2001-2011 Hartmut Kaiser
-//
-// Distributed under the Boost Software License, Version 1.0. (See accompanying
+//
+// 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)
 
 #if !defined(SPIRIT_KARMA_CORE_MARCH_06_2007_0833PM)

Modified: branches/release/boost/spirit/home/karma/detail/output_iterator.hpp
==============================================================================
--- branches/release/boost/spirit/home/karma/detail/output_iterator.hpp (original)
+++ branches/release/boost/spirit/home/karma/detail/output_iterator.hpp 2012-12-08 11:31:17 EST (Sat, 08 Dec 2012)
@@ -22,6 +22,10 @@
 #include <boost/spirit/home/support/iterators/ostream_iterator.hpp>
 #include <boost/spirit/home/support/unused.hpp>
 
+#if defined(BOOST_MSVC) && defined(BOOST_SPIRIT_UNICODE)
+#include <boost/spirit/home/support/char_encoding/unicode.hpp>
+#endif
+
 namespace boost { namespace spirit { namespace karma { namespace detail
 {
     ///////////////////////////////////////////////////////////////////////////
@@ -64,7 +68,7 @@
 
         template <typename T>
         void output(T const& value)
- {
+ {
             // track position in the output
             track_position_data.output(value);
         }
@@ -110,7 +114,7 @@
         }
 
         void output()
- {
+ {
             ++count;
         }
         std::size_t get_count() const { return count; }
@@ -147,7 +151,7 @@
 
         template <typename T>
         void output(T const&)
- {
+ {
             // count characters, if appropriate
             if (NULL != count)
                 count->output();
@@ -172,24 +176,33 @@
     ///////////////////////////////////////////////////////////////////////////
     class buffer_sink : boost::noncopyable
     {
+ // wchar_t is only 16-bits on Windows. If BOOST_SPIRIT_UNICODE is
+ // defined, the character type is 32-bits wide so we need to make
+ // sure the buffer is at least that wide.
+#if defined(BOOST_MSVC) && defined(BOOST_SPIRIT_UNICODE)
+ typedef spirit::char_encoding::unicode::char_type buffer_char_type;
+#else
+ typedef wchar_t buffer_char_type;
+#endif
+
     public:
         buffer_sink()
           : width(0) {}
 
         ~buffer_sink()
- {
+ {
             tidy();
         }
 
         void enable(std::size_t width_)
- {
+ {
             tidy(); // release existing buffer
             width = (width_ == std::size_t(-1)) ? 0 : width_;
             buffer.reserve(width);
         }
 
         void tidy()
- {
+ {
             buffer.clear();
             width = 0;
         }
@@ -197,18 +210,18 @@
         template <typename T>
         void output(T const& value)
         {
- BOOST_STATIC_ASSERT(sizeof(T) <= sizeof(wchar_t));
+ BOOST_STATIC_ASSERT(sizeof(T) <= sizeof(buffer_char_type));
             buffer.push_back(value);
         }
 
         template <typename OutputIterator_>
         bool copy(OutputIterator_& sink, std::size_t maxwidth) const
- {
+ {
 #if defined(BOOST_MSVC)
 #pragma warning(push)
 #pragma warning(disable: 4267)
 #endif
- typename std::basic_string<wchar_t>::const_iterator end =
+ typename std::basic_string<buffer_char_type>::const_iterator end =
                 buffer.begin() + (std::min)(buffer.size(), maxwidth);
 
 #if defined(BOOST_MSVC)
@@ -219,12 +232,12 @@
         }
         template <typename RestIterator>
         bool copy_rest(RestIterator& sink, std::size_t start_at) const
- {
+ {
 #if defined(BOOST_MSVC)
 #pragma warning(push)
 #pragma warning(disable: 4267)
 #endif
- typename std::basic_string<wchar_t>::const_iterator begin =
+ typename std::basic_string<buffer_char_type>::const_iterator begin =
                 buffer.begin() + (std::min)(buffer.size(), start_at);
 
 #if defined(BOOST_MSVC)
@@ -235,13 +248,13 @@
         }
 
         std::size_t buffer_size() const
- {
+ {
             return buffer.size();
         }
 
     private:
         std::size_t width;
- std::basic_string<wchar_t> buffer;
+ std::basic_string<buffer_char_type> buffer;
     };
 
     ///////////////////////////////////////////////////////////////////////////
@@ -452,6 +465,9 @@
         // plain output iterators are considered to be good all the time
         bool good() const { return true; }
 
+ // allow to access underlying output iterator
+ OutputIterator& base() { return *sink; }
+
     protected:
         // this is the wrapped user supplied output iterator
         OutputIterator* sink;

Modified: branches/release/boost/spirit/home/karma/numeric/detail/numeric_utils.hpp
==============================================================================
--- branches/release/boost/spirit/home/karma/numeric/detail/numeric_utils.hpp (original)
+++ branches/release/boost/spirit/home/karma/numeric/detail/numeric_utils.hpp 2012-12-08 11:31:17 EST (Sat, 08 Dec 2012)
@@ -1,6 +1,6 @@
 // Copyright (c) 2001-2011 Hartmut Kaiser
-//
-// Distributed under the Boost Software License, Version 1.0. (See accompanying
+//
+// 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)
 
 #if !defined(BOOST_SPIRIT_KARMA_NUMERIC_UTILS_FEB_23_2007_0841PM)
@@ -25,11 +25,11 @@
 
 ///////////////////////////////////////////////////////////////////////////////
 //
-// The value BOOST_KARMA_NUMERICS_LOOP_UNROLL specifies, how to unroll the
+// The value BOOST_KARMA_NUMERICS_LOOP_UNROLL specifies, how to unroll the
 // integer string generation loop (see below).
 //
-// Set the value to some integer in between 0 (no unrolling) and the
-// largest expected generated integer string length (complete unrolling).
+// Set the value to some integer in between 0 (no unrolling) and the
+// largest expected generated integer string length (complete unrolling).
 // If not specified, this value defaults to 6.
 //
 ///////////////////////////////////////////////////////////////////////////////
@@ -37,15 +37,15 @@
 #define BOOST_KARMA_NUMERICS_LOOP_UNROLL 6
 #endif
 
-#if BOOST_KARMA_NUMERICS_LOOP_UNROLL < 0
+#if BOOST_KARMA_NUMERICS_LOOP_UNROLL < 0
 #error "Please set the BOOST_KARMA_NUMERICS_LOOP_UNROLL to a non-negative value!"
 #endif
 
 namespace boost { namespace spirit { namespace traits
-{
+{
     ///////////////////////////////////////////////////////////////////////
     //
- // return the absolute value from a given number, avoiding over- and
+ // return the absolute value from a given number, avoiding over- and
     // underflow
     //
     ///////////////////////////////////////////////////////////////////////
@@ -153,36 +153,36 @@
     template <typename T, typename Enable/* = void*/>
     struct is_negative
     {
- static bool call(T n)
- {
- return (n < 0) ? true : false;
+ static bool call(T n)
+ {
+ return (n < 0) ? true : false;
         }
     };
 
     template <>
     struct is_negative<float>
     {
- static bool call(float n)
- {
- return (spirit::detail::signbit)(n) ? true : false;
+ static bool call(float n)
+ {
+ return (spirit::detail::signbit)(n) ? true : false;
         }
     };
 
     template <>
     struct is_negative<double>
     {
- static bool call(double n)
- {
- return (spirit::detail::signbit)(n) ? true : false;
+ static bool call(double n)
+ {
+ return (spirit::detail::signbit)(n) ? true : false;
         }
     };
 
     template <>
     struct is_negative<long double>
     {
- static bool call(long double n)
- {
- return (spirit::detail::signbit)(n) ? true : false;
+ static bool call(long double n)
+ {
+ return (spirit::detail::signbit)(n) ? true : false;
         }
     };
 
@@ -196,36 +196,36 @@
     template <typename T, typename Enable/* = void*/>
     struct is_zero
     {
- static bool call(T n)
- {
- return (n == 0) ? true : false;
+ static bool call(T n)
+ {
+ return (n == 0) ? true : false;
         }
     };
 
     template <>
     struct is_zero<float>
     {
- static bool call(float n)
- {
- return (math::fpclassify)(n) == FP_ZERO;
+ static bool call(float n)
+ {
+ return (math::fpclassify)(n) == FP_ZERO;
         }
     };
 
     template <>
     struct is_zero<double>
     {
- static bool call(double n)
- {
- return (math::fpclassify)(n) == FP_ZERO;
+ static bool call(double n)
+ {
+ return (math::fpclassify)(n) == FP_ZERO;
         }
     };
 
     template <>
     struct is_zero<long double>
     {
- static bool call(long double n)
- {
- return (math::fpclassify)(n) == FP_ZERO;
+ static bool call(long double n)
+ {
+ return (math::fpclassify)(n) == FP_ZERO;
         }
     };
 
@@ -239,8 +239,8 @@
     template <typename T, typename Enable/* = void*/>
     struct is_nan
     {
- static bool call(T n)
- {
+ static bool call(T n)
+ {
             // NaN numbers are not equal to anything
             return (n != n) ? true : false;
         }
@@ -249,27 +249,27 @@
     template <>
     struct is_nan<float>
     {
- static bool call(float n)
- {
- return (math::fpclassify)(n) == FP_NAN;
+ static bool call(float n)
+ {
+ return (math::fpclassify)(n) == FP_NAN;
         }
     };
 
     template <>
     struct is_nan<double>
     {
- static bool call(double n)
- {
- return (math::fpclassify)(n) == FP_NAN;
+ static bool call(double n)
+ {
+ return (math::fpclassify)(n) == FP_NAN;
         }
     };
 
     template <>
     struct is_nan<long double>
     {
- static bool call(long double n)
- {
- return (math::fpclassify)(n) == FP_NAN;
+ static bool call(long double n)
+ {
+ return (math::fpclassify)(n) == FP_NAN;
         }
     };
 
@@ -283,36 +283,38 @@
     template <typename T, typename Enable/* = void*/>
     struct is_infinite
     {
- static bool call(T n)
- {
- return (n == std::numeric_limits<T>::infinity()) ? true : false;
+ static bool call(T n)
+ {
+ if (!std::numeric_limits<T>::has_infinity)
+ return false;
+ return (n == std::numeric_limits<T>::infinity()) ? true : false;
         }
     };
 
     template <>
     struct is_infinite<float>
     {
- static bool call(float n)
- {
- return (math::fpclassify)(n) == FP_INFINITE;
+ static bool call(float n)
+ {
+ return (math::fpclassify)(n) == FP_INFINITE;
         }
     };
 
     template <>
     struct is_infinite<double>
     {
- static bool call(double n)
- {
- return (math::fpclassify)(n) == FP_INFINITE;
+ static bool call(double n)
+ {
+ return (math::fpclassify)(n) == FP_INFINITE;
         }
     };
 
     template <>
     struct is_infinite<long double>
     {
- static bool call(long double n)
- {
- return (math::fpclassify)(n) == FP_INFINITE;
+ static bool call(long double n)
+ {
+ return (math::fpclassify)(n) == FP_INFINITE;
         }
     };
 
@@ -343,7 +345,7 @@
         template <typename T>
         static long call(T n, mpl::false_)
         {
- // allow for ADL to find the correct overload for floor and
+ // allow for ADL to find the correct overload for floor and
             // lround
             using namespace std;
             return lround(floor(n));
@@ -367,19 +369,19 @@
     {
         static long call(float n, mpl::false_)
         {
- return test_negative(n) ? static_cast<long>(std::ceil(n)) :
+ return test_negative(n) ? static_cast<long>(std::ceil(n)) :
                 static_cast<long>(std::floor(n));
         }
 
         static long call(double n, mpl::false_)
         {
- return test_negative(n) ? static_cast<long>(std::ceil(n)) :
+ return test_negative(n) ? static_cast<long>(std::ceil(n)) :
                 static_cast<long>(std::floor(n));
         }
 
         static long call(long double n, mpl::false_)
         {
- return test_negative(n) ? static_cast<long>(std::ceil(n)) :
+ return test_negative(n) ? static_cast<long>(std::ceil(n)) :
                 static_cast<long>(std::floor(n));
         }
 
@@ -408,7 +410,7 @@
     //
     // Traits class for radix specific number conversion
     //
- // Convert a digit from binary representation to character
+ // Convert a digit from binary representation to character
     // representation:
     //
     // static int call(unsigned n);
@@ -451,7 +453,7 @@
     }
 
     template <unsigned Radix, typename CharEncoding, typename Tag>
- struct convert_digit
+ struct convert_digit
       : detail::convert_digit<CharEncoding, Tag, (Radix <= 10) ? true : false>
     {};
 
@@ -469,7 +471,7 @@
         static T call(T& n, mpl::false_)
         {
             // Allow ADL to find the correct overload for floor
- using namespace std;
+ using namespace std;
             return floor(n / Radix);
         }
 
@@ -500,7 +502,7 @@
         static T call(T, T& num, int exp, mpl::false_)
         {
             // Allow ADL to find the correct overload for floor
- using namespace std;
+ using namespace std;
             return floor(num / spirit::traits::pow10<T>(exp));
         }
 
@@ -524,7 +526,7 @@
         template <typename T>
         static long call(T n, mpl::true_)
         {
- // this cast is safe since we know the result is not larger
+ // this cast is safe since we know the result is not larger
             // than Radix
             return static_cast<long>(n % Radix);
         }
@@ -533,7 +535,7 @@
         static long call(T n, mpl::false_)
         {
             // Allow ADL to find the correct overload for fmod
- using namespace std;
+ using namespace std;
             return cast_to_long::call(fmod(n, T(Radix)));
         }
 
@@ -545,16 +547,16 @@
     };
 }}}
 
-namespace boost { namespace spirit { namespace karma
-{
+namespace boost { namespace spirit { namespace karma
+{
     ///////////////////////////////////////////////////////////////////////////
     //
- // The int_inserter template takes care of the integer to string
+ // The int_inserter template takes care of the integer to string
     // conversion. If specified, the loop is unrolled for better performance.
     //
- // Set the value BOOST_KARMA_NUMERICS_LOOP_UNROLL to some integer in
- // between 0 (no unrolling) and the largest expected generated integer
- // string length (complete unrolling).
+ // Set the value BOOST_KARMA_NUMERICS_LOOP_UNROLL to some integer in
+ // between 0 (no unrolling) and the largest expected generated integer
+ // string length (complete unrolling).
     // If not specified, this value defaults to 6.
     //
     ///////////////////////////////////////////////////////////////////////////
@@ -591,7 +593,7 @@
                 BOOST_KARMA_NUMERICS_LOOP_UNROLL,
                 BOOST_KARMA_NUMERICS_INNER_LOOP_PREFIX, _);
 
- if (!traits::test_zero(n))
+ if (!traits::test_zero(n))
                 call(sink, n, num, exp);
 
             BOOST_PP_REPEAT(
@@ -627,9 +629,9 @@
         }
 
     public:
- // Specialization for doubles and floats, falling back to long integers
+ // Specialization for doubles and floats, falling back to long integers
         // for representable values. These specializations speed up formatting
- // of floating point numbers considerably as all the required
+ // of floating point numbers considerably as all the required
         // arithmetics will be executed using integral data types.
         template <typename OutputIterator>
         static bool
@@ -671,7 +673,7 @@
 
     ///////////////////////////////////////////////////////////////////////////
     //
- // The uint_inserter template takes care of the conversion of any integer
+ // The uint_inserter template takes care of the conversion of any integer
     // to a string, while interpreting the number as an unsigned type.
     //
     ///////////////////////////////////////////////////////////////////////////
@@ -697,7 +699,7 @@
     //
     // The sign_inserter template generates a sign for a given numeric value.
     //
- // The parameter forcesign allows to generate a sign even for positive
+ // The parameter forcesign allows to generate a sign even for positive
     // numbers.
     //
     ///////////////////////////////////////////////////////////////////////////
@@ -720,9 +722,9 @@
         call_force(OutputIterator& sink, bool is_zero, bool is_negative)
         {
             // generate a sign for all numbers except zero
- if (!is_zero)
+ if (!is_zero)
                 *sink = is_negative ? '-' : '+';
- else
+ else
                 *sink = ' ';
 
             ++sink;

Modified: branches/release/boost/spirit/home/karma/numeric/detail/real_utils.hpp
==============================================================================
--- branches/release/boost/spirit/home/karma/numeric/detail/real_utils.hpp (original)
+++ branches/release/boost/spirit/home/karma/numeric/detail/real_utils.hpp 2012-12-08 11:31:17 EST (Sat, 08 Dec 2012)
@@ -46,11 +46,11 @@
         call (OutputIterator& sink, U n, Policies const& p = Policies())
         {
             if (traits::test_nan(n)) {
- return Policies::template nan<CharEncoding, Tag>(
+ return p.template nan<CharEncoding, Tag>(
                     sink, n, p.force_sign(n));
             }
             else if (traits::test_infinite(n)) {
- return Policies::template inf<CharEncoding, Tag>(
+ return p.template inf<CharEncoding, Tag>(
                     sink, n, p.force_sign(n));
             }
             return p.template call<real_inserter>(sink, n, p);

Modified: branches/release/boost/spirit/home/karma/operator/list.hpp
==============================================================================
--- branches/release/boost/spirit/home/karma/operator/list.hpp (original)
+++ branches/release/boost/spirit/home/karma/operator/list.hpp 2012-12-08 11:31:17 EST (Sat, 08 Dec 2012)
@@ -47,12 +47,12 @@
         template <typename F, typename Attribute>
         bool generate_left(F f, Attribute const&, mpl::false_) const
         {
- // Failing subject generators are just skipped. This allows to
+ // Failing subject generators are just skipped. This allows to
             // selectively generate items in the provided attribute.
             while (!f.is_at_end())
             {
                 bool r = !f(left);
- if (r)
+ if (r)
                     return true;
                 if (!f.is_at_end())
                     f.next();
@@ -66,7 +66,7 @@
             return !f(left);
         }
 
- // There is no way to distinguish a failed generator from a
+ // There is no way to distinguish a failed generator from a
         // generator to be skipped. We assume the user takes responsibility
         // for ending the loop if no attribute is specified.
         template <typename F>
@@ -80,9 +80,9 @@
         typedef Right right_type;
 
         typedef mpl::int_<
- left_type::properties::value
- | right_type::properties::value
- | generator_properties::buffering
+ left_type::properties::value
+ | right_type::properties::value
+ | generator_properties::buffering
           | generator_properties::counting
> properties;
 
@@ -96,7 +96,7 @@
         {};
 
         base_list(Left const& left, Right const& right)
- : left(left), right(right)
+ : left(left), right(right)
         {}
 
         template <
@@ -113,8 +113,8 @@
                 typename add_const<Attribute>::type
>::type iterator_type;
 
- typedef
- typename traits::make_indirect_iterator<iterator_type>::type
+ typedef
+ typename traits::make_indirect_iterator<iterator_type>::type
             indirect_iterator_type;
             typedef detail::pass_container<
                 fail_function, Attribute, indirect_iterator_type, mpl::false_>
@@ -123,7 +123,7 @@
             iterator_type it = traits::begin(attr);
             iterator_type end = traits::end(attr);
 
- pass_container pass(fail_function(sink, ctx, d),
+ pass_container pass(fail_function(sink, ctx, d),
                 indirect_iterator_type(it), indirect_iterator_type(end));
 
             if (generate_left(pass, attr, Strict()))
@@ -160,7 +160,7 @@
     };
 
     template <typename Left, typename Right>
- struct list
+ struct list
       : base_list<Left, Right, mpl::false_, list<Left, Right> >
     {
         typedef base_list<Left, Right, mpl::false_, list> base_list_;
@@ -170,7 +170,7 @@
     };
 
     template <typename Left, typename Right>
- struct strict_list
+ struct strict_list
       : base_list<Left, Right, mpl::true_, strict_list<Left, Right> >
     {
         typedef base_list<Left, Right, mpl::true_, strict_list> base_list_;
@@ -185,12 +185,12 @@
     namespace detail
     {
         template <typename Subject, bool strict_mode = false>
- struct make_list
+ struct make_list
           : make_binary_composite<Subject, list>
         {};
 
         template <typename Subject>
- struct make_list<Subject, true>
+ struct make_list<Subject, true>
           : make_binary_composite<Subject, strict_list>
         {};
     }
@@ -216,13 +216,13 @@
     template <typename Left, typename Right, typename Attribute
       , typename Context, typename Iterator>
     struct handles_container<karma::list<Left, Right>, Attribute
- , Context, Iterator>
+ , Context, Iterator>
       : mpl::true_ {};
 
     template <typename Left, typename Right, typename Attribute
       , typename Context, typename Iterator>
     struct handles_container<karma::strict_list<Left, Right>, Attribute
- , Context, Iterator>
+ , Context, Iterator>
       : mpl::true_ {};
 }}}
 

Modified: branches/release/boost/spirit/home/support/attributes.hpp
==============================================================================
--- branches/release/boost/spirit/home/support/attributes.hpp (original)
+++ branches/release/boost/spirit/home/support/attributes.hpp 2012-12-08 11:31:17 EST (Sat, 08 Dec 2012)
@@ -1,6 +1,6 @@
 /*=============================================================================
     Copyright (c) 2001-2011 Joel de Guzman
- Copyright (c) 2001-2011 Hartmut Kaiser
+ Copyright (c) 2001-2012 Hartmut Kaiser
 
     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)
@@ -520,6 +520,29 @@
         }
     };
 
+ namespace detail
+ {
+ struct attribute_size_visitor : static_visitor<>
+ {
+ template <typename T>
+ typename attribute_size<T>::type operator()(T const& val) const
+ {
+ return spirit::traits::size(val);
+ }
+ };
+ }
+
+ template <BOOST_VARIANT_ENUM_PARAMS(typename T)>
+ struct attribute_size<variant<BOOST_VARIANT_ENUM_PARAMS(T)> >
+ {
+ typedef std::size_t type;
+
+ static void call(variant<BOOST_VARIANT_ENUM_PARAMS(T)> const& val)
+ {
+ apply_visitor(detail::attribute_size_visitor(), val);
+ }
+ };
+
     template <typename Iterator>
     struct attribute_size<iterator_range<Iterator> >
     {

Modified: branches/release/libs/spirit/classic/doc/multi_pass.html
==============================================================================
--- branches/release/libs/spirit/classic/doc/multi_pass.html (original)
+++ branches/release/libs/spirit/classic/doc/multi_pass.html 2012-12-08 11:31:17 EST (Sat, 08 Dec 2012)
@@ -248,7 +248,7 @@
 <a name="checkingpolicy"></a>
 <h4>CheckingPolicy</h4>
 <p> The CheckingPolicy must have the following interface:</p>
-<pre> <code><span class="keyword">class </span><span class="identifier">my_check<br> </span><span class="special">{<br> </span><span class="keyword">protected</span><span class="special">:<br><br> </span><span class="identifier">my_check</span><span class="special">();<br> </span><span class="identifier">my_check</span><span class="special">(</span><span class="identifier">my_check </span><span class="keyword">const</span><span class="special">&amp; </span><span class="identifier">x</span><span class="special">);<br> </span><span class="keyword">void </span><span class="identifier">destroy</span><span class="special">();<br> </span><span class="keyword">void </span><span class="identifier">swap</span><span class="special">(</span><span class="identifier">my_check</span><span class="special">&amp; </span><span class="identifier">x</span><span class="special">);<br> </span><span class="comment">// check should make sure that this iterator is valid<br> </span>
<span class="keyword">void </span><span class="identifier">check</span><span class="special">() </span><span class="keyword">const</span><span class="special">;<br> </span><span class="keyword">void </span><span class="identifier">clear_queue</span><span class="special">();<br> </span><span class="special">};<br></span></code></pre>
+<pre> <code><span class="keyword">class </span><span class="identifier">my_check<br> </span><span class="special">{<br> </span><span class="keyword">protected</span><span class="special">:<br><br> </span><span class="identifier">my_check</span><span class="special">();<br> </span><span class="identifier">my_check</span><span class="special">(</span><span class="identifier">my_check </span><span class="keyword">const</span><span class="special">&amp; </span><span class="identifier">x</span><span class="special">);<br> </span><span class="keyword">void </span><span class="identifier">destroy</span><span class="special">();<br> </span><span class="keyword">void </span><span class="identifier">swap</span><span class="special">(</span><span class="identifier">my_check</span><span class="special">&amp; </span><span class="identifier">x</span><span class="special">);<br> </span><span class="comment">// check should make sure that this iterator is valid<br> </span>
<span class="keyword">void </span><span class="identifier">check_if_valid</span><span class="special">() </span><span class="keyword">const</span><span class="special">;<br> </span><span class="keyword">void </span><span class="identifier">clear_queue</span><span class="special">();<br> </span><span class="special">};<br></span></code></pre>
 <a name="storagepolicy"></a>
 <h4>StoragePolicy</h4>
 <p> A StoragePolicy must have the following interface:</p>

Modified: branches/release/libs/spirit/doc/karma/numeric.qbk
==============================================================================
--- branches/release/libs/spirit/doc/karma/numeric.qbk (original)
+++ branches/release/libs/spirit/doc/karma/numeric.qbk 2012-12-08 11:31:17 EST (Sat, 08 Dec 2012)
@@ -875,8 +875,7 @@
           Moreover, this precision will be limited to the value of
           `std::numeric_limits<T>::digits10 + 1`.]]
 [ [``
- template <bool ForceSign,
- typename OutputIterator>
+ template <typename OutputIterator>
         bool integer_part(OutputIterator& sink
           , Num n, bool sign, bool force_sign);
     ``]

Modified: branches/release/libs/spirit/doc/what_s_new.qbk
==============================================================================
--- branches/release/libs/spirit/doc/what_s_new.qbk (original)
+++ branches/release/libs/spirit/doc/what_s_new.qbk 2012-12-08 11:31:17 EST (Sat, 08 Dec 2012)
@@ -1,6 +1,6 @@
 [/==============================================================================
     Copyright (C) 2001-2011 Joel de Guzman
- Copyright (C) 2001-2011 Hartmut Kaiser
+ Copyright (C) 2001-2012 Hartmut Kaiser
 
     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)
@@ -27,6 +27,8 @@
   (thanks to Lee Clagett for submitting a patch).
 * Fixed __karma__ examples (thanks to Lee Clagett for submitting a patch).
 * Fixed #6368: [multi_pass] clear_queue isn't forwarded to the storage policy.
+* Fixed a problem in __karma__ when a variant holding a container was used as
+ a generator inside a sequence.
 
 [endsect]
 

Modified: branches/release/libs/spirit/example/qi/compiler_tutorial/calc7/compiler.hpp
==============================================================================
--- branches/release/libs/spirit/example/qi/compiler_tutorial/calc7/compiler.hpp (original)
+++ branches/release/libs/spirit/example/qi/compiler_tutorial/calc7/compiler.hpp 2012-12-08 11:31:17 EST (Sat, 08 Dec 2012)
@@ -82,4 +82,4 @@
     };
 }}
 
-#endif
\ No newline at end of file
+#endif

Modified: branches/release/libs/spirit/example/qi/compiler_tutorial/calc8/compiler.hpp
==============================================================================
--- branches/release/libs/spirit/example/qi/compiler_tutorial/calc8/compiler.hpp (original)
+++ branches/release/libs/spirit/example/qi/compiler_tutorial/calc8/compiler.hpp 2012-12-08 11:31:17 EST (Sat, 08 Dec 2012)
@@ -89,4 +89,4 @@
     };
 }}
 
-#endif
\ No newline at end of file
+#endif

Modified: branches/release/libs/spirit/example/qi/compiler_tutorial/conjure1/compiler.hpp
==============================================================================
--- branches/release/libs/spirit/example/qi/compiler_tutorial/conjure1/compiler.hpp (original)
+++ branches/release/libs/spirit/example/qi/compiler_tutorial/conjure1/compiler.hpp 2012-12-08 11:31:17 EST (Sat, 08 Dec 2012)
@@ -120,4 +120,4 @@
     };
 }}
 
-#endif
\ No newline at end of file
+#endif

Modified: branches/release/libs/spirit/example/qi/compiler_tutorial/conjure2/compiler.hpp
==============================================================================
--- branches/release/libs/spirit/example/qi/compiler_tutorial/conjure2/compiler.hpp (original)
+++ branches/release/libs/spirit/example/qi/compiler_tutorial/conjure2/compiler.hpp 2012-12-08 11:31:17 EST (Sat, 08 Dec 2012)
@@ -120,4 +120,4 @@
     };
 }}
 
-#endif
\ No newline at end of file
+#endif

Modified: branches/release/libs/spirit/example/qi/compiler_tutorial/mini_c/compiler.hpp
==============================================================================
--- branches/release/libs/spirit/example/qi/compiler_tutorial/mini_c/compiler.hpp (original)
+++ branches/release/libs/spirit/example/qi/compiler_tutorial/mini_c/compiler.hpp 2012-12-08 11:31:17 EST (Sat, 08 Dec 2012)
@@ -115,4 +115,4 @@
     };
 }}
 
-#endif
\ No newline at end of file
+#endif

Modified: branches/release/libs/spirit/test/Jamfile
==============================================================================
--- branches/release/libs/spirit/test/Jamfile (original)
+++ branches/release/libs/spirit/test/Jamfile 2012-12-08 11:31:17 EST (Sat, 08 Dec 2012)
@@ -250,6 +250,9 @@
      [ run karma/regression_semantic_action_attribute.cpp : : : : karma_regression_semantic_action_attribute ]
      [ run karma/regression_real_scientific.cpp : : : : karma_regression_real_scientific ]
      [ run karma/regression_center_alignment.cpp : : : : karma_regression_center_alignment ]
+ [ run karma/regression_container_variant_sequence.cpp : : : : karma_regression_container_variant_sequence ]
+ [ run karma/regression_real_0.cpp : : : : karma_regression_real_0 ]
+ [ run karma/regression_unicode_char.cpp : : : : karma_regression_unicode_char ]
 
     ;
 

Modified: branches/release/libs/spirit/test/qi/alternative.cpp
==============================================================================
--- branches/release/libs/spirit/test/qi/alternative.cpp (original)
+++ branches/release/libs/spirit/test/qi/alternative.cpp 2012-12-08 11:31:17 EST (Sat, 08 Dec 2012)
@@ -59,12 +59,12 @@
 
 struct DIgnore
 {
- std::string text;
+ std::string text;
 };
 
 struct DInclude
 {
- std::string FileName;
+ std::string FileName;
 };
 
 BOOST_FUSION_ADAPT_STRUCT(

Modified: branches/release/libs/spirit/test/qi/uint_radix.hpp
==============================================================================
--- branches/release/libs/spirit/test/qi/uint_radix.hpp (original)
+++ branches/release/libs/spirit/test/qi/uint_radix.hpp 2012-12-08 11:31:17 EST (Sat, 08 Dec 2012)
@@ -139,4 +139,4 @@
 char const* unsigned_overflow_base36 = "1Z141Z4";
 char const* digit_overflow_base36 = "1Z141Z30";
 
-#endif
\ No newline at end of file
+#endif

Modified: branches/release/libs/spirit/test/support/utree.cpp
==============================================================================
--- branches/release/libs/spirit/test/support/utree.cpp (original)
+++ branches/release/libs/spirit/test/support/utree.cpp 2012-12-08 11:31:17 EST (Sat, 08 Dec 2012)
@@ -468,8 +468,8 @@
 
     // tags
     {
- short min = std::numeric_limits<short>::min();
- short max = std::numeric_limits<short>::max();
+ short min = (std::numeric_limits<short>::min)();
+ short max = (std::numeric_limits<short>::max)();
 
         utree::list_type u;
         utree u2;


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