Boost logo

Boost-Commit :

Subject: [Boost-commit] svn:boost r58706 - in trunk/boost/spirit/home/support: . iterators iterators/detail
From: hartmut.kaiser_at_[hidden]
Date: 2010-01-05 08:45:39


Author: hkaiser
Date: 2010-01-05 08:45:39 EST (Tue, 05 Jan 2010)
New Revision: 58706
URL: http://svn.boost.org/trac/boost/changeset/58706

Log:
Spirit: fixing gcc related issues in multi_pass
Text files modified:
   trunk/boost/spirit/home/support/iterators/detail/combine_policies.hpp | 19 ++++++++++++++-----
   trunk/boost/spirit/home/support/iterators/detail/fixed_size_queue_policy.hpp | 5 +++--
   trunk/boost/spirit/home/support/iterators/detail/split_std_deque_policy.hpp | 4 ++--
   trunk/boost/spirit/home/support/iterators/multi_pass.hpp | 9 +++------
   trunk/boost/spirit/home/support/multi_pass.hpp | 3 ++-
   5 files changed, 24 insertions(+), 16 deletions(-)

Modified: trunk/boost/spirit/home/support/iterators/detail/combine_policies.hpp
==============================================================================
--- trunk/boost/spirit/home/support/iterators/detail/combine_policies.hpp (original)
+++ trunk/boost/spirit/home/support/iterators/detail/combine_policies.hpp 2010-01-05 08:45:39 EST (Tue, 05 Jan 2010)
@@ -30,6 +30,7 @@
       : Ownership, Checking, Input, Storage
     {
         multi_pass_unique() {}
+ multi_pass_unique(T& x) : Input(x) {}
         multi_pass_unique(T const& x) : Input(x) {}
 
         template <typename MultiPass>
@@ -66,6 +67,7 @@
       : Ownership, Checking, Input, Storage
     {
         multi_pass_unique() {}
+ multi_pass_unique(T& x) : Input(x) {}
         multi_pass_unique(T const& x) : Input(x) {}
 
         template <typename MultiPass>
@@ -117,7 +119,7 @@
 
         template <typename TokenType, typename MultiPass>
         inline static TokenType const& get_input(MultiPass& mp)
- { return Input::get_input<TokenType>(mp); }
+ { return Input::template get_input<TokenType>(mp); }
 
         template <typename MultiPass>
         inline static bool input_at_eof(MultiPass const& mp)
@@ -136,6 +138,7 @@
       : Ownership, Input, Storage
     {
         multi_pass_unique() {}
+ multi_pass_unique(T& x) : Input(x) {}
         multi_pass_unique(T const& x) : Input(x) {}
 
         template <typename MultiPass>
@@ -192,7 +195,7 @@
 
         template <typename TokenType, typename MultiPass>
         inline static TokenType const& get_input(MultiPass& mp)
- { return Input::get_input<TokenType>(mp); }
+ { return Input::template get_input<TokenType>(mp); }
 
         template <typename MultiPass>
         inline static bool input_at_eof(MultiPass const& mp)
@@ -220,6 +223,7 @@
       : Checking, Input, Storage
     {
         multi_pass_unique() {}
+ multi_pass_unique(T& x) : Input(x) {}
         multi_pass_unique(T const& x) : Input(x) {}
 
         template <typename MultiPass>
@@ -280,7 +284,7 @@
 
         template <typename TokenType, typename MultiPass>
         inline static TokenType const& get_input(MultiPass& mp)
- { return Input::get_input<TokenType>(mp); }
+ { return Input::template get_input<TokenType>(mp); }
 
         template <typename MultiPass>
         inline static bool input_at_eof(MultiPass const& mp)
@@ -312,8 +316,9 @@
       : Input, Storage
     {
         multi_pass_unique() {}
+ multi_pass_unique(T& x) : Input(x) {}
         multi_pass_unique(T const& x) : Input(x) {}
-
+
         template <typename MultiPass>
         static void destroy(MultiPass& mp)
         {
@@ -377,7 +382,7 @@
 
         template <typename TokenType, typename MultiPass>
         inline static TokenType const& get_input(MultiPass& mp)
- { return Input::get_input<TokenType>(mp); }
+ { return Input::template get_input<TokenType>(mp); }
 
         template <typename MultiPass>
         inline static bool input_at_eof(MultiPass const& mp)
@@ -420,6 +425,7 @@
     struct multi_pass_shared : Ownership, Checking, Input, Storage
     {
         explicit multi_pass_shared(T& input) : Input(input) {}
+ explicit multi_pass_shared(T const& input) : Input(input) {}
     };
 
     ///////////////////////////////////////////////////////////////////////////
@@ -455,6 +461,7 @@
 
             unique() {}
             explicit unique(T& input) : unique_base_type(input) {}
+ explicit unique(T const& input) : unique_base_type(input) {}
         };
 
         ///////////////////////////////////////////////////////////////////////
@@ -478,6 +485,8 @@
 
             explicit shared(T& input)
               : shared_base_type(input), inhibit_clear_queue_(false) {}
+ explicit shared(T const& input)
+ : shared_base_type(input), inhibit_clear_queue_(false) {}
 
             // This is needed for the correct implementation of expectation
             // points. Normally expectation points flush any multi_pass

Modified: trunk/boost/spirit/home/support/iterators/detail/fixed_size_queue_policy.hpp
==============================================================================
--- trunk/boost/spirit/home/support/iterators/detail/fixed_size_queue_policy.hpp (original)
+++ trunk/boost/spirit/home/support/iterators/detail/fixed_size_queue_policy.hpp 2010-01-05 08:45:39 EST (Tue, 05 Jan 2010)
@@ -57,7 +57,7 @@
             {
                 if (mp.queuePosition == mp.shared()->queuedElements.end())
                 {
- return MultiPass::get_input(mp);
+ return MultiPass::template get_input<Value>(mp);
                 }
                 return *mp.queuePosition;
             }
@@ -74,7 +74,8 @@
                     if (mp.shared()->queuedElements.size() >= N)
                         mp.shared()->queuedElements.pop_front();
 
- mp.shared()->queuedElements.push_back(MultiPass::get_input(mp));
+ mp.shared()->queuedElements.push_back(
+ MultiPass::template get_input<Value>(mp));
                     MultiPass::advance_input(mp);
                 }
                 ++mp.queuePosition;

Modified: trunk/boost/spirit/home/support/iterators/detail/split_std_deque_policy.hpp
==============================================================================
--- trunk/boost/spirit/home/support/iterators/detail/split_std_deque_policy.hpp (original)
+++ trunk/boost/spirit/home/support/iterators/detail/split_std_deque_policy.hpp 2010-01-05 08:45:39 EST (Tue, 05 Jan 2010)
@@ -66,7 +66,7 @@
                         queue.clear();
                         mp.queued_position = 0;
                     }
- return MultiPass::get_input<Value>(mp);
+ return MultiPass::template get_input<Value>(mp);
                 }
 
                 return queue[mp.queued_position];
@@ -101,7 +101,7 @@
                     }
                     else
                     {
- queue.push_back(MultiPass::get_input<Value>(mp));
+ queue.push_back(MultiPass::template get_input<Value>(mp));
                         ++mp.queued_position;
                     }
                     MultiPass::advance_input(mp);

Modified: trunk/boost/spirit/home/support/iterators/multi_pass.hpp
==============================================================================
--- trunk/boost/spirit/home/support/iterators/multi_pass.hpp (original)
+++ trunk/boost/spirit/home/support/iterators/multi_pass.hpp 2010-01-05 08:45:39 EST (Tue, 05 Jan 2010)
@@ -58,15 +58,12 @@
 
         multi_pass() : member_base((shared_data_type*)0) {}
 
- // Newer versions of gcc (and perhaps other compilers) are known to
- // generate warnings about the base class and the 'shared' member
- // being initialized in the wrong order ('shared' is initialized before
- // the base class). This is fully intended behavior as some policies
- // rely on the fact that their shared part is initialized before their
- // unique part. Please ignore the warnings, these are harmless.
         explicit multi_pass(T& input)
           : member_base(new shared_data_type(input)), policies_base_type(input) {}
 
+ explicit multi_pass(T const& input)
+ : member_base(new shared_data_type(input)), policies_base_type(input) {}
+
         multi_pass(multi_pass const& x)
           : member_base(x.member), policies_base_type(x)
         {

Modified: trunk/boost/spirit/home/support/multi_pass.hpp
==============================================================================
--- trunk/boost/spirit/home/support/multi_pass.hpp (original)
+++ trunk/boost/spirit/home/support/multi_pass.hpp 2010-01-05 08:45:39 EST (Tue, 05 Jan 2010)
@@ -10,13 +10,14 @@
 #pragma once
 #endif
 
-// Include everything needed for the default configuration of multi_pass
+// Include everything needed for the multi_pass
 // Ownership policies
 #include <boost/spirit/home/support/iterators/detail/first_owner_policy.hpp>
 #include <boost/spirit/home/support/iterators/detail/ref_counted_policy.hpp>
 
 // Input policies
 #include <boost/spirit/home/support/iterators/detail/input_iterator_policy.hpp>
+#include <boost/spirit/home/support/iterators/detail/istream_policy.hpp>
 #include <boost/spirit/home/support/iterators/detail/lex_input_policy.hpp>
 #include <boost/spirit/home/support/iterators/detail/split_functor_input_policy.hpp>
 


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