Boost logo

Boost-Commit :

Subject: [Boost-commit] svn:boost r55576 - in trunk/boost/spirit/home: karma/numeric qi/nonterminal support
From: hartmut.kaiser_at_[hidden]
Date: 2009-08-13 20:53:26


Author: hkaiser
Date: 2009-08-13 20:53:25 EDT (Thu, 13 Aug 2009)
New Revision: 55576
URL: http://svn.boost.org/trac/boost/changeset/55576

Log:
Spirit: trying to fix compilation problems with older versions of Boost while BOOST_SPIRIT_DEBUG is defined
Text files modified:
   trunk/boost/spirit/home/karma/numeric/real_policies.hpp | 23 +++++++++++------------
   trunk/boost/spirit/home/qi/nonterminal/debug_handler.hpp | 1 +
   trunk/boost/spirit/home/qi/nonterminal/simple_trace.hpp | 26 +-------------------------
   trunk/boost/spirit/home/support/unused.hpp | 28 ++++++++++++++++++++++++++++
   4 files changed, 41 insertions(+), 37 deletions(-)

Modified: trunk/boost/spirit/home/karma/numeric/real_policies.hpp
==============================================================================
--- trunk/boost/spirit/home/karma/numeric/real_policies.hpp (original)
+++ trunk/boost/spirit/home/karma/numeric/real_policies.hpp 2009-08-13 20:53:25 EDT (Thu, 13 Aug 2009)
@@ -92,10 +92,10 @@
         // between 0.001 and 100000 will be generated using the fixed format,
         // all others will be generated using the scientific representation.
         //
- // The trailing_zeros_flag can be used to force the output of trailing
- // zeros in the fractional part up to the number of digits returned by
- // the precision() member function. The default is not to generate
- // the trailing zeros.
+ // The function trailing_zeros() can be used to force the output of
+ // trailing zeros in the fractional part up to the number of digits
+ // returned by the precision() member function. The default is not to
+ // generate the trailing zeros.
         //
         // n The floating point number to output. This can be used to
         // adjust the formatting flags depending on the value of
@@ -182,13 +182,12 @@
         // I.e. a fractional part of 0.01234 is represented as 1234
         // when the 'precision_' parameter is 5.
         //
- // Note: If the trailing_zeros flag is not returned from the
- // floatfield() function, the 'precision_' parameter will have
- // been corrected from the value the precision() function
- // returned earlier (defining the maximal number of fractional
- // digits) in the sense, that it takes into account trailing
- // zeros. I.e. a floating point number 0.0123 and a value of 5
- // returned from precision() will result in:
+ // Note: If trailing_zeros() does not return true the 'precision_'
+ // parameter will have been corrected from the value the
+ // precision() function returned earlier (defining the maximal
+ // number of fractional digits) in the sense, that it takes into
+ // account trailing zeros. I.e. a floating point number 0.0123
+ // and a value of 5 returned from precision() will result in:
         //
         // trailing_zeros is not specified:
         // n 123
@@ -250,7 +249,7 @@
         //
         // sink The output iterator to use for generation
         // n The (signed) floating point number to convert.
- //
+ //
         // The Tag template parameter is either of the type unused_type or
         // describes the character class and conversion to be applied to any
         // output possibly influenced by either the lower[...] or upper[...]

Modified: trunk/boost/spirit/home/qi/nonterminal/debug_handler.hpp
==============================================================================
--- trunk/boost/spirit/home/qi/nonterminal/debug_handler.hpp (original)
+++ trunk/boost/spirit/home/qi/nonterminal/debug_handler.hpp 2009-08-13 20:53:25 EDT (Thu, 13 Aug 2009)
@@ -11,6 +11,7 @@
 #pragma once
 #endif
 
+#include <boost/spirit/home/support/unused.hpp>
 #include <boost/spirit/home/qi/nonterminal/rule.hpp>
 #include <boost/spirit/home/qi/operator/expect.hpp>
 #include <boost/function.hpp>

Modified: trunk/boost/spirit/home/qi/nonterminal/simple_trace.hpp
==============================================================================
--- trunk/boost/spirit/home/qi/nonterminal/simple_trace.hpp (original)
+++ trunk/boost/spirit/home/qi/nonterminal/simple_trace.hpp 2009-08-13 20:53:25 EDT (Thu, 13 Aug 2009)
@@ -11,6 +11,7 @@
 #pragma once
 #endif
 
+#include <boost/spirit/home/support/unused.hpp>
 #include <boost/fusion/include/out.hpp>
 #include <iostream>
 
@@ -29,31 +30,6 @@
 #define BOOST_SPIRIT_DEBUG_INDENT 2
 #endif
 
-#if !defined(BOOST_FUSION_UNUSED_HAS_IO)
-namespace boost { namespace fusion
-{
- namespace detail
- {
- struct unused_only
- {
- unused_only(unused_type const&) {}
- };
- }
-
- template <typename Out>
- inline Out& operator<<(Out& out, detail::unused_only const&)
- {
- return out;
- }
-
- template <typename In>
- inline In& operator>>(In& in, unused_type&)
- {
- return in;
- }
-}}
-#endif
-
 namespace boost { namespace spirit { namespace qi
 {
     struct simple_trace

Modified: trunk/boost/spirit/home/support/unused.hpp
==============================================================================
--- trunk/boost/spirit/home/support/unused.hpp (original)
+++ trunk/boost/spirit/home/support/unused.hpp 2009-08-13 20:53:25 EDT (Thu, 13 Aug 2009)
@@ -14,6 +14,34 @@
 #include <boost/fusion/include/unused.hpp>
 #include <boost/mpl/bool.hpp>
 
+///////////////////////////////////////////////////////////////////////////////
+// implement streaming operators for unused_type for older versions of Fusion
+#if !defined(BOOST_FUSION_UNUSED_HAS_IO)
+namespace boost { namespace fusion
+{
+ namespace detail
+ {
+ struct unused_only
+ {
+ unused_only(unused_type const&) {}
+ };
+ }
+
+ template <typename Out>
+ inline Out& operator<<(Out& out, detail::unused_only const&)
+ {
+ return out;
+ }
+
+ template <typename In>
+ inline In& operator>>(In& in, unused_type&)
+ {
+ return in;
+ }
+}}
+#endif
+
+///////////////////////////////////////////////////////////////////////////////
 namespace boost { namespace spirit
 {
     ///////////////////////////////////////////////////////////////////////////


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