update boost

This commit is contained in:
2023-11-24 12:56:13 -06:00
parent cfc99971af
commit 19d727037a
9260 changed files with 849256 additions and 299957 deletions

View File

@@ -26,7 +26,7 @@
// for phrase parsers. Actors should implement at least one of the two ()
// operator.
//
// Actor instances are not created direcly since they usually involve a
// Actor instances are not created directly since they usually involve a
// number of template parameters. Instead generator functions ("helper
// functions") are provided to generate actors according to their arguments.
// All helper functions have the "_a" suffix. For example, append_actor is

View File

@@ -18,7 +18,7 @@ BOOST_SPIRIT_CLASSIC_NAMESPACE_BEGIN
///////////////////////////////////////////////////////////////////////////
// Summary:
// A semantic action policy that applies the assignement operator.
// A semantic action policy that applies the assignment operator.
// (This doc uses convention available in actors.hpp)
//
// Actions (what it does):

View File

@@ -81,7 +81,7 @@ BOOST_SPIRIT_CLASSIC_NAMESPACE_BEGIN
template <typename ResultT, typename ParserT, typename ScannerT>
ResultT& post_parse(ResultT& hit, ParserT const&, ScannerT const&)
{ hit.value(frame[::phoenix::tuple_index<0>()]); return hit; }
{ hit.value(frame[::phoenix::tuple_index_names::_1]); return hit; }
private:
@@ -121,7 +121,7 @@ BOOST_SPIRIT_CLASSIC_NAMESPACE_BEGIN
template <typename ResultT, typename ParserT, typename ScannerT>
ResultT& post_parse(ResultT& hit, ParserT const&, ScannerT const&)
{ hit.value(frame[::phoenix::tuple_index<0>()]); return hit; }
{ hit.value(frame[::phoenix::tuple_index_names::_1]); return hit; }
private:

View File

@@ -9,9 +9,6 @@
#if !defined(BOOST_SPIRIT_ASSERT_HPP)
#define BOOST_SPIRIT_ASSERT_HPP
#include <boost/config.hpp>
#include <boost/throw_exception.hpp>
///////////////////////////////////////////////////////////////////////////////
//
// BOOST_SPIRIT_ASSERT is used throughout the framework. It can be
@@ -24,10 +21,11 @@
#if defined(NDEBUG)
#define BOOST_SPIRIT_ASSERT(x)
#elif defined (BOOST_SPIRIT_ASSERT_EXCEPTION)
#include <boost/throw_exception.hpp>
#define BOOST_SPIRIT_ASSERT_AUX(f, l, x) BOOST_SPIRIT_ASSERT_AUX2(f, l, x)
#define BOOST_SPIRIT_ASSERT_AUX2(f, l, x) \
do{ if (!(x)) boost::throw_exception( \
BOOST_SPIRIT_ASSERT_EXCEPTION(f "(" #l "): " #x)); } while(0)
( (x) ? (void)0 : boost::throw_exception( \
BOOST_SPIRIT_ASSERT_EXCEPTION(f "(" #l "): " #x)) )
#define BOOST_SPIRIT_ASSERT(x) BOOST_SPIRIT_ASSERT_AUX(__FILE__, __LINE__, x)
#else
#include <boost/assert.hpp>

View File

@@ -30,7 +30,7 @@ BOOST_SPIRIT_CLASSIC_NAMESPACE_BEGIN
//
// condition_parser class
//
// handles expresions of the form
// handles expressions of the form
//
// epsilon_p(cond)
//
@@ -93,7 +93,7 @@ BOOST_SPIRIT_CLASSIC_NAMESPACE_BEGIN
//
// handles expressions of the form
// epsilon_p(subject)
// where subject is a parser. The expresion returns a composite
// where subject is a parser. The expression returns a composite
// parser that returns an empty match if the subject parser matches.
//
///////////////////////////////////////////////////////////////////////////////

View File

@@ -49,7 +49,7 @@
//
/////////////////////////////////////////////////////////////////////////////////
#if (defined(BOOST_MSVC) && (BOOST_MSVC < 1310)) \
|| (defined(__BORLANDC__) && (__BORLANDC__ <= 0x570)) \
|| (defined(BOOST_BORLANDC) && (BOOST_BORLANDC <= 0x570)) \
|| (defined(__GNUC__) && (__GNUC__ < 3)) \
|| (defined(__GNUC__) && (__GNUC__ == 3) && (__GNUC_MINOR__ < 1))
# error "Compiler not supported. See note in <boost/spirit/core/config.hpp>"

View File

@@ -34,7 +34,7 @@ BOOST_SPIRIT_CLASSIC_NAMESPACE_BEGIN
// length of the match is the number of characters (or tokens) that
// is successfully matched. This can be queried through its length()
// member function. A negative value means that the match is
// unsucessful.
// unsuccessful.
//
// Each parser may have an associated attribute. This attribute is
// also returned back to the client on a successful parse through

View File

@@ -170,7 +170,7 @@ struct grammar_definition
}
int
undefine(grammar_t* target_grammar)
undefine(grammar_t* target_grammar) BOOST_OVERRIDE
{
typename grammar_t::object_id id = target_grammar->get_object_id();

View File

@@ -102,7 +102,7 @@ BOOST_SPIRIT_CLASSIC_NAMESPACE_BEGIN
#ifdef BOOST_SPIRIT_THREADSAFE
boost::unique_lock<boost::mutex> lock(mutex);
#endif
if (free_ids.size())
if (!free_ids.empty())
{
object_id id = *free_ids.rbegin();
free_ids.pop_back();

View File

@@ -114,8 +114,7 @@ BOOST_SPIRIT_CLASSIC_NAMESPACE_BEGIN
class rule_base_access
{
#if defined(BOOST_NO_MEMBER_TEMPLATE_FRIENDS) \
|| BOOST_WORKAROUND(__BORLANDC__, BOOST_TESTED_AT(0x551))
#if defined(BOOST_NO_MEMBER_TEMPLATE_FRIENDS)
public: // YUCK!
#else
template <
@@ -233,16 +232,16 @@ BOOST_SPIRIT_CLASSIC_NAMESPACE_BEGIN
struct concrete_parser : abstract_parser<ScannerT, AttrT>
{
concrete_parser(ParserT const& p_) : p(p_) {}
virtual ~concrete_parser() {}
~concrete_parser() BOOST_OVERRIDE {}
virtual typename match_result<ScannerT, AttrT>::type
do_parse_virtual(ScannerT const& scan) const
typename match_result<ScannerT, AttrT>::type
do_parse_virtual(ScannerT const& scan) const BOOST_OVERRIDE
{
return p.parse(scan);
}
virtual abstract_parser<ScannerT, AttrT>*
clone() const
abstract_parser<ScannerT, AttrT>*
clone() const BOOST_OVERRIDE
{
return new concrete_parser(p);
}

View File

@@ -133,7 +133,7 @@ BOOST_SPIRIT_CLASSIC_NAMESPACE_BEGIN
//////////////////////////////////
// if-parser, conditionally runs a parser is a functor condition is true.
// If the condition is fales, it fails the parse.
// If the condition is false, it fails the parse.
// It can optionally become an if-else-parser through the member else_p.
template <typename ParsableT, typename CondT>
struct if_parser

View File

@@ -72,8 +72,9 @@ struct parse_tuple_element {
typedef typename ScannerT::iterator_t iterator_t;
typedef typename parser_result<parser_t, ScannerT>::type result_t;
iterator_t save(scan.first);
result_t result(t[::phoenix::tuple_index<index>()].parse(scan));
iterator_t save(scan.first);
::phoenix::tuple_index<index> const idx;
result_t result(t[idx].parse(scan));
if (result) {
return scan.create_match(result.length(), TupleT::length - N,
@@ -98,8 +99,9 @@ struct parse_tuple_element<1, ResultT, TupleT, BehaviourT> {
typedef typename ScannerT::iterator_t iterator_t;
typedef typename parser_result<parser_t, ScannerT>::type result_t;
iterator_t save(scan.first);
result_t result(t[::phoenix::tuple_index<index>()].parse(scan));
iterator_t save(scan.first);
::phoenix::tuple_index<index> const idx;
result_t result(t[idx].parse(scan));
if (result) {
return scan.create_match(result.length(), TupleT::length - 1,

View File

@@ -222,7 +222,7 @@ struct default_case<CaseT, true> {
};
///////////////////////////////////////////////////////////////////////////////
// The case_chain template calculates recursivly the depth of the left
// The case_chain template calculates recursively the depth of the left
// subchain of the given case branch node.
template <typename CaseT, bool IsSimple = CaseT::is_simple>
struct case_chain {
@@ -240,7 +240,7 @@ struct case_chain<CaseT, true> {
///////////////////////////////////////////////////////////////////////////////
// The chain_parser template is used to extract the type and the instance of
// a left or a right parser, burried arbitrary deep inside the case parser
// a left or a right parser, buried arbitrary deep inside the case parser
// chain.
template <int Depth, typename CaseT>
struct chain_parser {

View File

@@ -55,7 +55,7 @@ BOOST_SPIRIT_CLASSIC_NAMESPACE_BEGIN
///////////////////////////////////////////////////////////////////////////////
//
// The switch_parser allows to build switch like parsing constructs, which
// will have much better perfomance as comparable straight solutions.
// will have much better performance as comparable straight solutions.
//
// Input stream driven syntax:
//

View File

@@ -6,12 +6,12 @@
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 FIXED_SIZE_QUEUE
#define FIXED_SIZE_QUEUE
#ifndef BOOST_SPIRIT_CLASSIC_ITERATOR_FIXED_SIZE_QUEUE_HPP
#define BOOST_SPIRIT_CLASSIC_ITERATOR_FIXED_SIZE_QUEUE_HPP
#include <cstddef>
#include <cstdlib>
#include <iterator>
#include <cstddef>
#include <boost/spirit/home/classic/namespace.hpp>
#include <boost/spirit/home/classic/core/assert.hpp> // for BOOST_SPIRIT_ASSERT

View File

@@ -8,8 +8,8 @@
License, Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at
http://www.boost.org/LICENSE_1_0.txt)
=============================================================================*/
#ifndef POSITION_ITERATOR_IPP
#define POSITION_ITERATOR_IPP
#ifndef BOOST_SPIRIT_CLASSIC_ITERATOR_IMPL_POSITION_ITERATOR_IPP
#define BOOST_SPIRIT_CLASSIC_ITERATOR_IMPL_POSITION_ITERATOR_IPP
#include <boost/config.hpp>
#include <boost/iterator_adaptors.hpp>

View File

@@ -150,10 +150,10 @@ class BOOST_SYMBOL_VISIBLE illegal_backtracking : public std::exception
public:
illegal_backtracking() BOOST_NOEXCEPT_OR_NOTHROW {}
~illegal_backtracking() BOOST_NOEXCEPT_OR_NOTHROW {}
~illegal_backtracking() BOOST_NOEXCEPT_OR_NOTHROW BOOST_OVERRIDE {}
virtual const char*
what() const BOOST_NOEXCEPT_OR_NOTHROW
const char*
what() const BOOST_NOEXCEPT_OR_NOTHROW BOOST_OVERRIDE
{ return "BOOST_SPIRIT_CLASSIC_NS::illegal_backtracking"; }
};
@@ -163,7 +163,7 @@ public:
// This policy is most effective when used together with the std_deque
// StoragePolicy.
// If used with the fixed_size_queue StoragePolicy, it will not detect
// iterator derefereces that are out of the range of the queue.
// iterator dereferences that are out of the range of the queue.
///////////////////////////////////////////////////////////////////////////////
class buf_id_check
{
@@ -1296,5 +1296,3 @@ BOOST_SPIRIT_CLASSIC_NAMESPACE_END
}} // namespace BOOST_SPIRIT_CLASSIC_NS
#endif // BOOST_SPIRIT_ITERATOR_MULTI_PASS_HPP

View File

@@ -12,7 +12,6 @@
#include <string>
#include <boost/config.hpp>
#include <boost/concept_check.hpp>
#include <boost/spirit/home/classic/namespace.hpp>
#include <boost/spirit/home/classic/iterator/position_iterator_fwd.hpp>
@@ -294,7 +293,7 @@ private:
protected:
void newline(void)
void newline()
{}
ForwardIteratorT _end;
@@ -397,13 +396,13 @@ public:
return *this;
}
ForwardIteratorT get_currentline_begin(void) const
ForwardIteratorT get_currentline_begin() const
{ return _startline; }
ForwardIteratorT get_currentline_end(void) const
ForwardIteratorT get_currentline_end() const
{ return get_endline(); }
std::basic_string<value_type> get_currentline(void) const
std::basic_string<value_type> get_currentline() const
{
return std::basic_string<value_type>
(get_currentline_begin(), get_currentline_end());
@@ -425,7 +424,7 @@ protected:
return endline;
}
void newline(void)
void newline()
{ _startline = this->base(); }
};

View File

@@ -18,9 +18,9 @@ BOOST_SPIRIT_CLASSIC_NAMESPACE_BEGIN
///////////////////////////////////////////////////////////////////////////
//
// Helper templates to derive the parser type from an auxilliary type
// Helper templates to derive the parser type from an auxiliary type
// and to generate an object of the required parser type given an
// auxilliary object. Supported types to convert are parsers,
// auxiliary object. Supported types to convert are parsers,
// single characters and character strings.
//
///////////////////////////////////////////////////////////////////////////

View File

@@ -33,8 +33,7 @@ namespace impl
template <typename ParserT, typename LeafCountT>
struct count {
// __BORLANDC__ == 0x0561 isn't happy with BOOST_STATIC_CONSTANT
enum { value = (LeafCountT::value + 1) };
BOOST_STATIC_CONSTANT(int, value = (LeafCountT::value + 1));
};
};
@@ -47,9 +46,8 @@ namespace impl
typedef typename ParserT::subject_t subject_t;
typedef typename subject_t::parser_category_t subject_category_t;
// __BORLANDC__ == 0x0561 isn't happy with BOOST_STATIC_CONSTANT
enum { value = (nodes<subject_category_t>
::template count<subject_t, LeafCountT>::value + 1) };
BOOST_STATIC_CONSTANT(int, value = (nodes<subject_category_t>
::template count<subject_t, LeafCountT>::value + 1));
};
};
@@ -62,9 +60,8 @@ namespace impl
typedef typename ParserT::subject_t subject_t;
typedef typename subject_t::parser_category_t subject_category_t;
// __BORLANDC__ == 0x0561 isn't happy with BOOST_STATIC_CONSTANT
enum { value = (nodes<subject_category_t>
::template count<subject_t, LeafCountT>::value + 1) };
BOOST_STATIC_CONSTANT(int, value = (nodes<subject_category_t>
::template count<subject_t, LeafCountT>::value + 1));
};
};
@@ -81,14 +78,14 @@ namespace impl
typedef count self_t;
// __BORLANDC__ == 0x0561 isn't happy with BOOST_STATIC_CONSTANT
enum {
BOOST_STATIC_CONSTANT(int,
leftcount = (nodes<left_category_t>
::template count<left_t, LeafCountT>::value),
::template count<left_t, LeafCountT>::value));
BOOST_STATIC_CONSTANT(int,
rightcount = (nodes<right_category_t>
::template count<right_t, LeafCountT>::value),
value = ((self_t::leftcount) + (self_t::rightcount) + 1)
};
::template count<right_t, LeafCountT>::value));
BOOST_STATIC_CONSTANT(int,
value = ((self_t::leftcount) + (self_t::rightcount) + 1));
};
};
@@ -108,8 +105,7 @@ namespace impl
template <typename ParserT, typename LeafCountT>
struct count {
// __BORLANDC__ == 0x0561 isn't happy with BOOST_STATIC_CONSTANT
enum { value = (LeafCountT::value + 1) };
BOOST_STATIC_CONSTANT(int, value = (LeafCountT::value + 1));
};
};
@@ -122,9 +118,8 @@ namespace impl
typedef typename ParserT::subject_t subject_t;
typedef typename subject_t::parser_category_t subject_category_t;
// __BORLANDC__ == 0x0561 isn't happy with BOOST_STATIC_CONSTANT
enum { value = (leafs<subject_category_t>
::template count<subject_t, LeafCountT>::value) };
BOOST_STATIC_CONSTANT(int, value = (leafs<subject_category_t>
::template count<subject_t, LeafCountT>::value));
};
};
@@ -137,9 +132,8 @@ namespace impl
typedef typename ParserT::subject_t subject_t;
typedef typename subject_t::parser_category_t subject_category_t;
// __BORLANDC__ == 0x0561 isn't happy with BOOST_STATIC_CONSTANT
enum { value = (leafs<subject_category_t>
::template count<subject_t, LeafCountT>::value) };
BOOST_STATIC_CONSTANT(int, value = (leafs<subject_category_t>
::template count<subject_t, LeafCountT>::value));
};
};
@@ -156,14 +150,14 @@ namespace impl
typedef count self_t;
// __BORLANDC__ == 0x0561 isn't happy with BOOST_STATIC_CONSTANT
enum {
BOOST_STATIC_CONSTANT(int,
leftcount = (leafs<left_category_t>
::template count<left_t, LeafCountT>::value),
::template count<left_t, LeafCountT>::value));
BOOST_STATIC_CONSTANT(int,
rightcount = (leafs<right_category_t>
::template count<right_t, LeafCountT>::value),
value = (self_t::leftcount + self_t::rightcount)
};
::template count<right_t, LeafCountT>::value));
BOOST_STATIC_CONSTANT(int,
value = (self_t::leftcount + self_t::rightcount));
};
};

View File

@@ -64,7 +64,7 @@ struct is_unary_composite {
//
// The is_acction_parser traits template can be used to tell if a given
// parser is a action parser, i.e. it is a composite consisting of a
// auxilliary parser and an attached semantic action.
// auxiliary parser and an attached semantic action.
//
///////////////////////////////////////////////////////////////////////////////
template <typename ActionT>

View File

@@ -18,7 +18,7 @@ BOOST_SPIRIT_CLASSIC_NAMESPACE_BEGIN
///////////////////////////////////////////////////////////////////////////
//
// Post-order traversal of auxilliary parsers.
// Post-order traversal of auxiliary parsers.
//
///////////////////////////////////////////////////////////////////////////
struct post_order

View File

@@ -6,8 +6,8 @@
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_CLASSIC_NAMESPACE_HPP)
#define SPIRIT_CLASSIC_NAMESPACE_HPP
#ifndef BOOST_SPIRIT_CLASSIC_NAMESPACE_HPP
#define BOOST_SPIRIT_CLASSIC_NAMESPACE_HPP
#if defined(BOOST_SPIRIT_USE_OLD_NAMESPACE)
@@ -19,7 +19,7 @@
#define BOOST_SPIRIT_CLASSIC_NAMESPACE_BEGIN /*namespace classic {*/
#define BOOST_SPIRIT_CLASSIC_NS boost::spirit/*::classic*/
#define BOOST_SPIRIT_CLASSIC_NAMESPACE_END /*}*/
#else
// This is the normal (and suggested) mode of operation when using
@@ -32,4 +32,4 @@
#endif
#endif
#endif

View File

@@ -5,8 +5,8 @@
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 PHOENIX_ACTOR_HPP
#define PHOENIX_ACTOR_HPP
#ifndef BOOST_SPIRIT_CLASSIC_PHOENIX_ACTOR_HPP
#define BOOST_SPIRIT_CLASSIC_PHOENIX_ACTOR_HPP
///////////////////////////////////////////////////////////////////////////////
#include <boost/spirit/home/classic/phoenix/tuples.hpp>

View File

@@ -5,8 +5,8 @@
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 PHOENIX_BINDERS_HPP
#define PHOENIX_BINDERS_HPP
#ifndef BOOST_SPIRIT_CLASSIC_PHOENIX_BINDERS_HPP
#define BOOST_SPIRIT_CLASSIC_PHOENIX_BINDERS_HPP
///////////////////////////////////////////////////////////////////////////////
#include <boost/spirit/home/classic/phoenix/functions.hpp>
@@ -20,7 +20,7 @@ namespace phoenix {
//
// Binders
//
// There are times when it is desireable to bind a simple functor,
// There are times when it is desirable to bind a simple functor,
// function, member function or member variable for deferred
// evaluation. This can be done through the binding facilities
// provided below. There are template classes:
@@ -170,7 +170,7 @@ namespace phoenix {
template <typename FuncT>
struct functor_action : public FuncT {
#if !defined(__BORLANDC__) && (!defined(__MWERKS__) || (__MWERKS__ > 0x3002))
#if !defined(BOOST_BORLANDC) && (!defined(__MWERKS__) || (__MWERKS__ > 0x3002))
template <
typename A = nil_t
@@ -209,7 +209,7 @@ struct functor_action : public FuncT {
: FuncT(fptr_) {}
};
#if defined(__BORLANDC__) || (defined(__MWERKS__) && (__MWERKS__ <= 0x3002))
#if defined(BOOST_BORLANDC) || (defined(__MWERKS__) && (__MWERKS__ <= 0x3002))
///////////////////////////////////////////////////////////////////////////////
//
@@ -2661,7 +2661,7 @@ struct bound_member
bound_member(CT & c, FPT fp)
: function<action_t>(action_t(c,fp)) {}
#if !defined(__BORLANDC__)
#if !defined(BOOST_BORLANDC)
template <typename CT, typename FPT>
bound_member(CT * c, FPT fp)
: function<action_t>(action_t(c,fp)) {}

View File

@@ -7,8 +7,8 @@
file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
==============================================================================*/
#ifndef PHOENIX_CASTS_HPP
#define PHOENIX_CASTS_HPP
#ifndef BOOST_SPIRIT_CLASSIC_PHOENIX_CASTS_HPP
#define BOOST_SPIRIT_CLASSIC_PHOENIX_CASTS_HPP
///////////////////////////////////////////////////////////////////////////////
#include <boost/spirit/home/classic/phoenix/actor.hpp>
@@ -183,7 +183,7 @@ const_cast_(actor<BaseAT> const& a)
// A a = construct_<A>(...arbitrary list of actors...);
//
// where the given parameters are submitted as parameters to the
// contructor of the object of type A. (This certainly implies, that
// constructor of the object of type A. (This certainly implies, that
// type A has a constructor with a fitting set of parameter types
// defined.)
//
@@ -849,7 +849,7 @@ struct construct_15 {
#endif
#if defined(__BORLANDC__) || (defined(__MWERKS__) && (__MWERKS__ <= 0x3002))
#if defined(BOOST_BORLANDC) || (defined(__MWERKS__) && (__MWERKS__ <= 0x3002))
///////////////////////////////////////////////////////////////////////////////
//
@@ -1467,4 +1467,4 @@ construct_(
///////////////////////////////////////////////////////////////////////////////
} // namespace phoenix
#endif // PHOENIX_CASTS_HPP
#endif

View File

@@ -6,8 +6,8 @@
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 CLASSIC_PHOENIX_CLOSURES_HPP
#define CLASSIC_PHOENIX_CLOSURES_HPP
#ifndef BOOST_SPIRIT_CLASSIC_PHOENIX_CLOSURES_HPP
#define BOOST_SPIRIT_CLASSIC_PHOENIX_CLOSURES_HPP
///////////////////////////////////////////////////////////////////////////////
#include <boost/spirit/home/classic/phoenix/actor.hpp>
@@ -119,7 +119,7 @@ namespace phoenix {
// where 'clos' is an instance of our closure 'my_closure' above.
// Take note that the usage above precludes locally declared
// classes. If my_closure is a locally declared type, we can still
// use its self_type as a paramater to closure_frame:
// use its self_type as a parameter to closure_frame:
//
// closure_frame<my_closure::self_type> frame(clos);
//
@@ -271,7 +271,8 @@ public:
{
using namespace std;
BOOST_ASSERT(frame.get() != 0);
return (*frame.get())[tuple_index<N>()];
tuple_index<N> const idx;
return (*frame.get())[idx];
}
private:

View File

@@ -5,8 +5,8 @@
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 PHOENIX_COMPOSITE_HPP
#define PHOENIX_COMPOSITE_HPP
#ifndef BOOST_SPIRIT_CLASSIC_PHOENIX_COMPOSITE_HPP
#define BOOST_SPIRIT_CLASSIC_PHOENIX_COMPOSITE_HPP
///////////////////////////////////////////////////////////////////////////////
#include <boost/spirit/home/classic/phoenix/actor.hpp>

View File

@@ -5,8 +5,8 @@
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 PHOENIX_FUNCTIONS_HPP
#define PHOENIX_FUNCTIONS_HPP
#ifndef BOOST_SPIRIT_CLASSIC_PHOENIX_FUNCTIONS_HPP
#define BOOST_SPIRIT_CLASSIC_PHOENIX_FUNCTIONS_HPP
///////////////////////////////////////////////////////////////////////////////
#include <boost/spirit/home/classic/phoenix/actor.hpp>

View File

@@ -8,8 +8,8 @@
file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
==============================================================================*/
#ifndef PHOENIX_NEW_HPP
#define PHOENIX_NEW_HPP
#ifndef BOOST_SPIRIT_CLASSIC_PHOENIX_NEW_HPP
#define BOOST_SPIRIT_CLASSIC_PHOENIX_NEW_HPP
///////////////////////////////////////////////////////////////////////////////
#include <boost/spirit/home/classic/phoenix/actor.hpp>
@@ -54,7 +54,7 @@ BOOST_STATIC_ASSERT(PHOENIX_CONSTRUCT_LIMIT <= 15);
// A *a = new_<A>(...arbitrary list of actors...);
//
// where the given parameters are submitted as parameters to the
// contructor of the object of type A. (This certainly implies, that
// constructor of the object of type A. (This certainly implies, that
// type A has a constructor with a fitting set of parameter types
// defined.)
//
@@ -694,7 +694,7 @@ struct new_15 {
#endif
#if defined(__BORLANDC__) || (defined(__MWERKS__) && (__MWERKS__ <= 0x3002))
#if defined(BOOST_BORLANDC) || (defined(__MWERKS__) && (__MWERKS__ <= 0x3002))
///////////////////////////////////////////////////////////////////////////////
//
@@ -1312,4 +1312,4 @@ new_(
///////////////////////////////////////////////////////////////////////////////
} // namespace phoenix
#endif // PHOENIX_NEW_HPP
#endif

View File

@@ -5,15 +5,15 @@
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 PHOENIX_OPERATORS_HPP
#define PHOENIX_OPERATORS_HPP
#ifndef BOOST_SPIRIT_CLASSIC_PHOENIX_OPERATORS_HPP
#define BOOST_SPIRIT_CLASSIC_PHOENIX_OPERATORS_HPP
///////////////////////////////////////////////////////////////////////////////
#if !defined(BOOST_NO_CWCTYPE)
#include <cwctype>
#endif
#if defined(__BORLANDC__) || (defined(__ICL) && __ICL >= 700)
#if (defined(__BORLANDC__) && !defined(__clang__)) || (defined(__ICL) && __ICL >= 700)
#define CREF const&
#else
#define CREF
@@ -290,7 +290,7 @@ struct unary_operator<dereference_op, nil_t> {
};
//////////////////////////////////
#ifndef __BORLANDC__
#ifndef BOOST_BORLANDC
template <>
struct unary_operator<dereference_op, nil_t const> {
@@ -345,7 +345,7 @@ struct unary_operator<post_decr_op, T> {
// type of binary operators such as +. The type with the higher
// rank wins and is used as the operator's return type. T1 generic
// user defined type has a very high rank and always wins when
// compared against a user defined type. If this is not desireable,
// compared against a user defined type. If this is not desirable,
// one can write a rank specialization for the type.
//
// Take note that ranks 0..9999 are reserved for the framework.

View File

@@ -5,8 +5,8 @@
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 PHOENIX_PRIMITIVES_HPP
#define PHOENIX_PRIMITIVES_HPP
#ifndef BOOST_SPIRIT_CLASSIC_PHOENIX_PRIMITIVES_HPP
#define BOOST_SPIRIT_CLASSIC_PHOENIX_PRIMITIVES_HPP
///////////////////////////////////////////////////////////////////////////////
#include <boost/spirit/home/classic/phoenix/actor.hpp>
@@ -56,7 +56,8 @@ struct argument {
typename tuple_element<N, TupleT>::type
eval(TupleT const& args) const
{
return args[tuple_index<N>()];
tuple_index<N> const idx;
return args[idx];
}
};

View File

@@ -5,8 +5,8 @@
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 PHOENIX_SPECIAL_OPS_HPP
#define PHOENIX_SPECIAL_OPS_HPP
#ifndef BOOST_SPIRIT_CLASSIC_PHOENIX_SPECIAL_OPS_HPP
#define BOOST_SPIRIT_CLASSIC_PHOENIX_SPECIAL_OPS_HPP
#include <boost/config.hpp>
#ifdef BOOST_NO_STRINGSTREAM
@@ -169,7 +169,7 @@ typedef PHOENIX_STD::ios_base& (*iomanip_t)(PHOENIX_STD::ios_base&);
typedef PHOENIX_STD::istream& (*imanip_t)(PHOENIX_STD::istream&);
typedef PHOENIX_STD::ostream& (*omanip_t)(PHOENIX_STD::ostream&);
#if defined(__BORLANDC__)
#if defined(BOOST_BORLANDC)
///////////////////////////////////////////////////////////////////////////////
//
@@ -195,7 +195,7 @@ omanip_t endl_ = &PHOENIX_STD::endl;
omanip_t ends_ = &PHOENIX_STD::ends;
omanip_t flush_ = &PHOENIX_STD::flush;
#else // __BORLANDC__
#else // BOOST_BORLANDC
///////////////////////////////////////////////////////////////////////////////
//
@@ -233,7 +233,7 @@ operator<<(actor<BaseT> const& _0, iomanip_t _1)
return impl::make_binary1<shift_l_op, BaseT, iomanip_t>::construct(_0, _1);
}
#endif // __BORLANDC__
#endif // BOOST_BORLANDC
///////////////////////////////////////////////////////////////////////////////
//

View File

@@ -5,8 +5,8 @@
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 PHOENIX_STATEMENTS_HPP
#define PHOENIX_STATEMENTS_HPP
#ifndef BOOST_SPIRIT_CLASSIC_PHOENIX_STATEMENTS_HPP
#define BOOST_SPIRIT_CLASSIC_PHOENIX_STATEMENTS_HPP
///////////////////////////////////////////////////////////////////////////////
#include <boost/spirit/home/classic/phoenix/composite.hpp>

View File

@@ -6,8 +6,8 @@
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 PHOENIX_TUPLEHELPERS_HPP
#define PHOENIX_TUPLEHELPERS_HPP
#ifndef BOOST_SPIRIT_CLASSIC_PHOENIX_TUPLE_HELPERS_HPP
#define BOOST_SPIRIT_CLASSIC_PHOENIX_TUPLE_HELPERS_HPP
///////////////////////////////////////////////////////////////////////////////
#include <cassert>
@@ -534,7 +534,8 @@ namespace impl
actor_element(ActorTupleT const& actor_tuple, is_not_default)
{
BOOST_STATIC_ASSERT(ActorTupleT::length <= TupleResultT::length);
return actor_tuple[tuple_index<N>()](); // apply the actor
tuple_index<N> const idx;
return actor_tuple[idx](); // apply the actor
}
static type
@@ -1072,4 +1073,4 @@ namespace impl
///////////////////////////////////////////////////////////////////////////////
} // namespace phoenix
#endif // PHOENIX_TUPLEHELPERS_HPP
#endif

View File

@@ -5,8 +5,8 @@
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 PHOENIX_TUPLES_HPP
#define PHOENIX_TUPLES_HPP
#ifndef BOOST_SPIRIT_CLASSIC_PHOENIX_TUPLES_HPP
#define BOOST_SPIRIT_CLASSIC_PHOENIX_TUPLES_HPP
///////////////////////////////////////////////////////////////////////////////
//
@@ -21,36 +21,6 @@
#define PHOENIX_LIMIT 3
#endif
#if defined(__BORLANDC__) && (__BORLANDC__ <= 0x561)
namespace phoenix { namespace borland_only
{
namespace ftors
{
// We define these dummy template functions. Borland complains when
// a template class has the same name as a template function,
// regardless if they are in different namespaces.
template <typename T> void if_(T) {}
template <typename T> void for_(T) {}
template <typename T> void while_(T) {}
template <typename T> void do_(T) {}
}
namespace tmpls
{
// We define these dummy template functions. Borland complains when
// a template class has the same name as a template function,
// regardless if they are in different namespaces.
template <typename T> struct if_ {};
template <typename T> struct for_ {};
template <typename T> struct while_ {};
template <typename T> struct do_ {};
}
}} // namespace phoenix::borland_only
#endif
///////////////////////////////////////////////////////////////////////////////
#include <boost/static_assert.hpp>
#include <boost/call_traits.hpp>
@@ -59,6 +29,8 @@ namespace phoenix { namespace borland_only
#if BOOST_WORKAROUND(BOOST_MSVC, >= 1400)
#pragma warning(push)
#pragma warning(disable:4512) //assignment operator could not be generated
// bogus https://developercommunity.visualstudio.com/t/buggy-warning-c4709/471956
#pragma warning(disable:4709) //comma operator within array index expression
#endif
///////////////////////////////////////////////////////////////////////////////

View File

@@ -87,7 +87,7 @@ struct ast_tree_policy :
typedef typename tree_match<iterator_t, NodeFactoryT, T>::container_t
container_t;
// test for size() is nessecary, because no_tree_gen_node leaves a.trees
// test for size() is necessary, because no_tree_gen_node leaves a.trees
// and/or b.trees empty
if (0 != b.trees.size() && b.trees.begin()->value.is_root())
{

View File

@@ -98,13 +98,6 @@ struct tree_node
impl::cp_swap(value, x.value);
impl::cp_swap(children, x.children);
}
// Intel V5.0.1 has a problem without this explicit operator=
tree_node &operator= (tree_node const &rhs)
{
tree_node(rhs).swap(*this);
return *this;
}
};
#if defined(BOOST_SPIRIT_DEBUG) && \
@@ -1515,7 +1508,7 @@ const action_directive_parser_gen<access_node_action> access_node_d
// length: The number of characters consumed by the parser.
// This is valid only if we have a successful match
// (either partial or full). A negative value means
// that the match is unsucessful.
// that the match is unsuccessful.
//
// trees: Contains the root node(s) of the tree.
//

View File

@@ -8,8 +8,8 @@
http://www.boost.org/LICENSE_1_0.txt)
=============================================================================*/
#if !defined(PARSE_TREE_UTILS_IPP)
#define PARSE_TREE_UTILS_IPP
#ifndef BOOST_SPIRIT_CLASSIC_TREE_IMPL_PARSE_TREE_UTILS_IPP
#define BOOST_SPIRIT_CLASSIC_TREE_IMPL_PARSE_TREE_UTILS_IPP
///////////////////////////////////////////////////////////////////////////////
namespace boost {
@@ -61,7 +61,7 @@ find_node (tree_node<T> const &node, parser_id node_to_search,
///////////////////////////////////////////////////////////////////////////////
//
// The functions 'get_node_range' return a pair of iterators pointing at the
// range, which containes the elements of a specified node.
// range, which contains the elements of a specified node.
//
///////////////////////////////////////////////////////////////////////////////
namespace impl {
@@ -132,4 +132,4 @@ BOOST_SPIRIT_CLASSIC_NAMESPACE_END
} // namespace spirit
} // namespace boost
#endif // !defined(PARSE_TREE_UTILS_IPP)
#endif

View File

@@ -8,8 +8,8 @@
http://www.boost.org/LICENSE_1_0.txt)
=============================================================================*/
#if !defined(TREE_TO_XML_IPP)
#define TREE_TO_XML_IPP
#ifndef BOOST_SPIRIT_CLASSIC_TREE_IMPL_TREE_TO_XML_IPP
#define BOOST_SPIRIT_CLASSIC_TREE_IMPL_TREE_TO_XML_IPP
#include <cstdio>
#include <cstdarg>
@@ -524,4 +524,4 @@ BOOST_SPIRIT_CLASSIC_NAMESPACE_END
#undef BOOST_SPIRIT_OSSTREAM
#undef BOOST_SPIRIT_GETSTRING
#endif // !defined(PARSE_TREE_XML_HPP)
#endif

View File

@@ -7,8 +7,8 @@
file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
=============================================================================*/
#if !defined(PARSE_TREE_UTILS_HPP)
#define PARSE_TREE_UTILS_HPP
#ifndef BOOST_SPIRIT_CLASSIC_TREE_PARSE_TREE_UTILS_HPP
#define BOOST_SPIRIT_CLASSIC_TREE_PARSE_TREE_UTILS_HPP
#include <utility> // for std::pair
@@ -44,7 +44,7 @@ find_node (tree_node<T> const &node, parser_id node_to_search,
///////////////////////////////////////////////////////////////////////////////
//
// The function 'get_node_range' return a pair of iterators pointing at the
// range, which containes the elements of a specified node. It's very useful
// range, which contains the elements of a specified node. It's very useful
// for locating all information related with a specified node.
//
///////////////////////////////////////////////////////////////////////////////
@@ -61,4 +61,4 @@ BOOST_SPIRIT_CLASSIC_NAMESPACE_END
#include <boost/spirit/home/classic/tree/impl/parse_tree_utils.ipp>
#endif // !defined(PARSE_TREE_UTILS_HPP)
#endif

View File

@@ -7,8 +7,8 @@
file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
=============================================================================*/
#if !defined(TREE_TO_XML_HPP)
#define TREE_TO_XML_HPP
#ifndef BOOST_SPIRIT_CLASSIC_TREE_TREE_TO_XML_HPP
#define BOOST_SPIRIT_CLASSIC_TREE_TREE_TO_XML_HPP
#include <boost/spirit/home/classic/namespace.hpp>
@@ -112,5 +112,5 @@ BOOST_SPIRIT_CLASSIC_NAMESPACE_END
#include <boost/spirit/home/classic/tree/impl/tree_to_xml.ipp>
#endif // !defined(TREE_TO_XML_HPP)
#endif

View File

@@ -97,7 +97,11 @@ namespace impl {
struct assign_zero_to_tuple_member {
template <typename TupleT>
static void do_(TupleT &t) { t[::phoenix::tuple_index<N>()] = 0; }
static void do_(TupleT &t)
{
::phoenix::tuple_index<N> const idx;
t[idx] = 0;
}
};
template <int N>
@@ -282,6 +286,8 @@ public:
// grammar.
BOOST_STATIC_ASSERT(N > 0 && N < tuple_t::length);
::phoenix::tuple_index<N> const idx;
// If the following assertion is fired, you have probably forgot to call
// the start_parser() function from inside the constructor of your
// embedded definition class to initialize the start parsers to be exposed
@@ -289,9 +295,9 @@ public:
// Another reason may be, that there is a count mismatch between
// the number of template parameters to the grammar_def<> class and the
// number of parameters used while calling start_parsers().
BOOST_SPIRIT_ASSERT(0 != t[::phoenix::tuple_index<N>()]);
BOOST_SPIRIT_ASSERT(0 != t[idx]);
return t[::phoenix::tuple_index<N>()];
return t[idx];
}
private:

View File

@@ -166,7 +166,7 @@ namespace impl {
return scan.no_match(); // overflow detected
}
};
#if (defined(BOOST_MSVC) && (BOOST_MSVC <= 1310))
#if defined(BOOST_MSVC)
#pragma warning(pop)
#endif

View File

@@ -267,7 +267,7 @@
//
// 3. Utilities for by-reference embedding
//
// When using parsers mutiple times or recursively it can be helpful to embed
// When using parsers multiple times or recursively it can be helpful to embed
// them by-reference into the final parser expression.
// For this purpose the library provides a wrapper template 'parser_reference'.
// There is also a function template to create a wrapped parser which can deduce
@@ -1001,7 +1001,7 @@ namespace type_of {
( concatenate_actions(chain.action(), a) );
}
// Expression template for mutiple action chain assignments
// Expression template for multiple action chain assignments
template<class ChainOrChains, class LastChain>
class action_chains
{

View File

@@ -10,10 +10,8 @@
///////////////////////////////////////////////////////////////////////////////
#include <boost/spirit/home/classic/namespace.hpp>
#include <boost/spirit/home/classic/core/composite/composite.hpp>
#include <boost/thread/lock_types.hpp>
#if !defined(BOOST_SPIRIT_COMPOSITE_HPP)
#include <boost/spirit/home/classic/core/composite.hpp>
#endif
///////////////////////////////////////////////////////////////////////////////
namespace boost { namespace spirit {

View File

@@ -5,8 +5,8 @@
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_CLASSIC_VERSION_HPP)
#define SPIRIT_CLASSIC_VERSION_HPP
#ifndef BOOST_SPIRIT_CLASSIC_VERSION_HPP
#define BOOST_SPIRIT_CLASSIC_VERSION_HPP
///////////////////////////////////////////////////////////////////////////////
//
@@ -16,4 +16,4 @@
#define SPIRIT_VERSION 0x1811
#define SPIRIT_PIZZA_VERSION SPIRIT_MEGA_VEGGI // :-)
#endif // defined(SPIRIT_VERSION_HPP)
#endif

View File

@@ -3,8 +3,8 @@
// 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)
#define SPIRIT_KARMA_CORE_MARCH_06_2007_0833PM
#ifndef BOOST_SPIRIT_KARMA_HPP
#define BOOST_SPIRIT_KARMA_HPP
#if defined(_MSC_VER)
#pragma once

View File

@@ -145,10 +145,6 @@ namespace boost { namespace spirit { namespace karma
T t_;
generator_impl_type generator_;
private:
// silence MSVC warning C4512: assignment operator could not be generated
lit_auto_generator& operator= (lit_auto_generator const&);
};
///////////////////////////////////////////////////////////////////////////

View File

@@ -23,6 +23,7 @@
#include <boost/mpl/vector.hpp>
#include <boost/mpl/push_back.hpp>
#include <boost/fusion/include/as_vector.hpp>
#include <boost/proto/tags.hpp>
#include <boost/type_traits/is_same.hpp>
///////////////////////////////////////////////////////////////////////////////

View File

@@ -3,8 +3,8 @@
// 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_ATTR_CAST_SEP_26_2009_0348PM)
#define SPIRIT_KARMA_ATTR_CAST_SEP_26_2009_0348PM
#ifndef BOOST_SPIRIT_KARMA_AUXILIARY_ATTR_CAST_HPP
#define BOOST_SPIRIT_KARMA_AUXILIARY_ATTR_CAST_HPP
#if defined(_MSC_VER)
#pragma once

View File

@@ -18,12 +18,18 @@
#include <boost/spirit/home/support/unused.hpp>
#include <boost/spirit/home/support/info.hpp>
#include <boost/spirit/home/support/lazy.hpp>
#include <boost/spirit/include/phoenix_core.hpp>
#include <boost/fusion/include/at.hpp>
#include <boost/utility/result_of.hpp>
#include <boost/proto/make_expr.hpp>
#include <boost/type_traits/remove_reference.hpp>
#include <boost/mpl/not.hpp>
namespace boost { namespace phoenix
{
template <typename Expr>
struct actor;
}}
namespace boost { namespace spirit
{
///////////////////////////////////////////////////////////////////////////
@@ -138,10 +144,6 @@ namespace boost { namespace spirit { namespace karma
Function func;
Modifiers modifiers;
private:
// silence MSVC warning C4512: assignment operator could not be generated
lazy_generator& operator= (lazy_generator const&);
};
///////////////////////////////////////////////////////////////////////////

View File

@@ -194,20 +194,11 @@ namespace boost { namespace spirit { namespace karma
};
///////////////////////////////////////////////////////////////////////
template <BOOST_SCOPED_ENUM(boost::spirit::endian::endianness) bits>
template <BOOST_SCOPED_ENUM(boost::endian::order) bits>
struct what;
template <>
struct what<boost::spirit::endian::endianness::native>
{
static info is()
{
return info("native-endian binary");
}
};
template <>
struct what<boost::spirit::endian::endianness::little>
struct what<boost::endian::order::little>
{
static info is()
{
@@ -216,7 +207,7 @@ namespace boost { namespace spirit { namespace karma
};
template <>
struct what<boost::spirit::endian::endianness::big>
struct what<boost::endian::order::big>
{
static info is()
{
@@ -226,7 +217,7 @@ namespace boost { namespace spirit { namespace karma
}
///////////////////////////////////////////////////////////////////////////
template <typename T, BOOST_SCOPED_ENUM(boost::spirit::endian::endianness) endian, int bits>
template <typename T, BOOST_SCOPED_ENUM(boost::endian::order) endian, int bits>
struct any_binary_generator
: primitive_generator<any_binary_generator<T, endian, bits> >
{
@@ -242,10 +233,7 @@ namespace boost { namespace spirit { namespace karma
if (!traits::has_optional_value(attr))
return false;
// Even if the endian types are not pod's (at least not in the
// definition of C++03) it seems to be safe to assume they are.
// This allows us to treat them as a sequence of consecutive bytes.
boost::spirit::endian::endian<endian, typename T::type, bits> p;
boost::endian::endian_arithmetic<endian, typename T::type, bits> p;
#if defined(BOOST_MSVC)
// warning C4244: 'argument' : conversion from 'const int' to 'foo', possible loss of data
@@ -258,8 +246,7 @@ namespace boost { namespace spirit { namespace karma
#pragma warning(pop)
#endif
unsigned char const* bytes =
reinterpret_cast<unsigned char const*>(&p);
unsigned char const* bytes = p.data();
for (unsigned int i = 0; i < sizeof(p); ++i)
{
@@ -293,7 +280,7 @@ namespace boost { namespace spirit { namespace karma
};
///////////////////////////////////////////////////////////////////////////
template <typename T, BOOST_SCOPED_ENUM(boost::spirit::endian::endianness) endian, int bits>
template <typename T, BOOST_SCOPED_ENUM(boost::endian::order) endian, int bits>
struct literal_binary_generator
: primitive_generator<literal_binary_generator<T, endian, bits> >
{
@@ -323,12 +310,7 @@ namespace boost { namespace spirit { namespace karma
bool generate(OutputIterator& sink, Context&, Delimiter const& d
, Attribute const&) const
{
// Even if the endian types are not pod's (at least not in the
// definition of C++03) it seems to be safe to assume they are
// (but in C++0x the endian types _are_ PODs).
// This allows us to treat them as a sequence of consecutive bytes.
unsigned char const* bytes =
reinterpret_cast<unsigned char const*>(&data_);
unsigned char const* bytes = data_.data();
for (unsigned int i = 0; i < sizeof(data_type); ++i)
{
@@ -344,7 +326,7 @@ namespace boost { namespace spirit { namespace karma
return karma::detail::what<endian>::is();
}
typedef boost::spirit::endian::endian<endian, typename T::type,
typedef boost::endian::endian_arithmetic<endian, typename T::type,
bits> data_type;
data_type data_;
@@ -355,7 +337,7 @@ namespace boost { namespace spirit { namespace karma
///////////////////////////////////////////////////////////////////////////
namespace detail
{
template <typename T, BOOST_SCOPED_ENUM(boost::spirit::endian::endianness) endian
template <typename T, BOOST_SCOPED_ENUM(boost::endian::order) endian
, int bits>
struct basic_binary
{
@@ -368,7 +350,7 @@ namespace boost { namespace spirit { namespace karma
};
template <typename Modifiers, typename T
, BOOST_SCOPED_ENUM(boost::spirit::endian::endianness) endian, int bits>
, BOOST_SCOPED_ENUM(boost::endian::order) endian, int bits>
struct basic_binary_literal
{
typedef literal_binary_generator<T, endian, bits> result_type;
@@ -385,13 +367,13 @@ namespace boost { namespace spirit { namespace karma
template <typename Modifiers> \
struct make_primitive<tag::name, Modifiers> \
: detail::basic_binary<detail::integer<bits>, \
boost::spirit::endian::endianness::endiantype, bits> {}; \
boost::endian::order::endiantype, bits> {}; \
\
template <typename Modifiers, typename A0> \
struct make_primitive<terminal_ex<tag::name, fusion::vector1<A0> > \
, Modifiers> \
: detail::basic_binary_literal<Modifiers, detail::integer<bits> \
, boost::spirit::endian::endianness::endiantype, bits> {}; \
, boost::endian::order::endiantype, bits> {}; \
\
/***/
@@ -414,13 +396,13 @@ namespace boost { namespace spirit { namespace karma
template <typename Modifiers> \
struct make_primitive<tag::name, Modifiers> \
: detail::basic_binary<detail::floating_point<bits>, \
boost::spirit::endian::endianness::endiantype, bits> {}; \
boost::endian::order::endiantype, bits> {}; \
\
template <typename Modifiers, typename A0> \
struct make_primitive<terminal_ex<tag::name, fusion::vector1<A0> > \
, Modifiers> \
: detail::basic_binary_literal<Modifiers, detail::floating_point<bits> \
, boost::spirit::endian::endianness::endiantype, bits> {}; \
, boost::endian::order::endiantype, bits> {}; \
\
/***/

View File

@@ -20,6 +20,8 @@
#include <boost/spirit/home/support/unused.hpp>
#include <boost/spirit/home/support/info.hpp>
#include <boost/spirit/home/support/container.hpp>
#include <boost/proto/operators.hpp>
#include <boost/proto/tags.hpp>
namespace boost { namespace spirit
{

View File

@@ -4,8 +4,8 @@
// 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_ALTERNATIVE_MAR_01_2007_1124AM)
#define SPIRIT_KARMA_ALTERNATIVE_MAR_01_2007_1124AM
#ifndef BOOST_SPIRIT_KARMA_DETAIL_ALTERNATIVE_FUNCTION_HPP
#define BOOST_SPIRIT_KARMA_DETAIL_ALTERNATIVE_FUNCTION_HPP
#if defined(_MSC_VER)
#pragma once
@@ -55,7 +55,7 @@ namespace boost { namespace spirit { namespace karma { namespace detail
, Delimiter const& d, unused_type, bool&)
{
#if BOOST_WORKAROUND(BOOST_MSVC, BOOST_TESTED_AT(1600))
component; // suppresses warning: C4100: 'component' : unreferenced formal parameter
(void)component; // suppresses warning: C4100: 'component' : unreferenced formal parameter
#endif
// return true if any of the generators succeed
return component.generate(sink, ctx, d, unused);
@@ -87,7 +87,7 @@ namespace boost { namespace spirit { namespace karma { namespace detail
, Context& ctx, Delimiter const& d, Attribute const& attr, bool&)
{
#if BOOST_WORKAROUND(BOOST_MSVC, BOOST_TESTED_AT(1600))
component; // suppresses warning: C4100: 'component' : unreferenced formal parameter
(void)component; // suppresses warning: C4100: 'component' : unreferenced formal parameter
#endif
return call(component, sink, ctx, d, attr
, spirit::traits::not_is_variant_or_variant_in_optional<Attribute, karma::domain>());
@@ -99,7 +99,7 @@ namespace boost { namespace spirit { namespace karma { namespace detail
, Context& ctx, Delimiter const& d, Attribute const& attr, mpl::true_)
{
#if BOOST_WORKAROUND(BOOST_MSVC, BOOST_TESTED_AT(1600))
component; // suppresses warning: C4100: 'component' : unreferenced formal parameter
(void)component; // suppresses warning: C4100: 'component' : unreferenced formal parameter
#endif
return component.generate(sink, ctx, d, attr);
}
@@ -110,7 +110,7 @@ namespace boost { namespace spirit { namespace karma { namespace detail
, Context& ctx, Delimiter const& d, Attribute const& attr, mpl::false_)
{
#if BOOST_WORKAROUND(BOOST_MSVC, BOOST_TESTED_AT(1600))
component; // suppresses warning: C4100: 'component' : unreferenced formal parameter
(void)component; // suppresses warning: C4100: 'component' : unreferenced formal parameter
#endif
typedef
traits::compute_compatible_component<Expected, Attribute, domain>
@@ -139,6 +139,10 @@ namespace boost { namespace spirit { namespace karma { namespace detail
// will be executed for every generator in a given alternative generator
// expression
///////////////////////////////////////////////////////////////////////////
#ifdef _MSC_VER
# pragma warning(push)
# pragma warning(disable: 4512) // assignment operator could not be generated.
#endif
template <typename OutputIterator, typename Context, typename Delimiter,
typename Attribute, typename Strict>
struct alternative_generate_function
@@ -190,10 +194,6 @@ namespace boost { namespace spirit { namespace karma { namespace detail
Context& ctx;
Delimiter const& delim;
Attribute const& attr;
private:
// silence MSVC warning C4512: assignment operator could not be generated
alternative_generate_function& operator= (alternative_generate_function const&);
};
// specialization for strict alternatives
@@ -240,11 +240,10 @@ namespace boost { namespace spirit { namespace karma { namespace detail
Delimiter const& delim;
Attribute const& attr;
bool failed;
private:
// silence MSVC warning C4512: assignment operator could not be generated
alternative_generate_function& operator= (alternative_generate_function const&);
};
#ifdef _MSC_VER
# pragma warning(pop)
#endif
}}}}
#endif

View File

@@ -4,8 +4,8 @@
// 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_DETAIL_ATTRIBUTES_APR_18_2010_0453PM)
#define SPIRIT_KARMA_DETAIL_ATTRIBUTES_APR_18_2010_0453PM
#ifndef BOOST_SPIRIT_KARMA_DETAIL_ATTRIBUTES_HPP
#define BOOST_SPIRIT_KARMA_DETAIL_ATTRIBUTES_HPP
#include <boost/spirit/home/karma/domain.hpp>
#include <boost/spirit/home/support/attributes_fwd.hpp>

View File

@@ -10,7 +10,6 @@
#pragma once
#endif
#include <boost/spirit/include/phoenix_core.hpp>
#include <boost/spirit/home/support/unused.hpp>
#include <boost/spirit/home/support/attributes_fwd.hpp>
#include <boost/spirit/home/karma/detail/attributes.hpp>

View File

@@ -4,8 +4,8 @@
// 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_SEQUENCE_FEB_28_2007_0249PM)
#define SPIRIT_KARMA_SEQUENCE_FEB_28_2007_0249PM
#ifndef BOOST_SPIRIT_KARMA_DETAIL_FAIL_FUNCTION_HPP
#define BOOST_SPIRIT_KARMA_DETAIL_FAIL_FUNCTION_HPP
#if defined(_MSC_VER)
#pragma once
@@ -16,6 +16,10 @@
namespace boost { namespace spirit { namespace karma { namespace detail
{
#ifdef _MSC_VER
# pragma warning(push)
# pragma warning(disable: 4512) // assignment operator could not be generated.
#endif
template <typename OutputIterator, typename Context, typename Delimiter>
struct fail_function
{
@@ -30,7 +34,7 @@ namespace boost { namespace spirit { namespace karma { namespace detail
bool operator()(Component const& component, Attribute const& attr) const
{
#if BOOST_WORKAROUND(BOOST_MSVC, BOOST_TESTED_AT(1600))
component; // suppresses warning: C4100: 'component' : unreferenced formal parameter
(void)component; // suppresses warning: C4100: 'component' : unreferenced formal parameter
#endif
// return true if any of the generators fail
return !component.generate(sink, ctx, delim, attr);
@@ -40,7 +44,7 @@ namespace boost { namespace spirit { namespace karma { namespace detail
bool operator()(Component const& component) const
{
#if BOOST_WORKAROUND(BOOST_MSVC, BOOST_TESTED_AT(1600))
component; // suppresses warning: C4100: 'component' : unreferenced formal parameter
(void)component; // suppresses warning: C4100: 'component' : unreferenced formal parameter
#endif
// return true if any of the generators fail
return !component.generate(sink, ctx, delim, unused);
@@ -49,11 +53,10 @@ namespace boost { namespace spirit { namespace karma { namespace detail
OutputIterator& sink;
Context& ctx;
Delimiter const& delim;
private:
// silence MSVC warning C4512: assignment operator could not be generated
fail_function& operator= (fail_function const&);
};
#ifdef _MSC_VER
# pragma warning(pop)
#endif
}}}}

View File

@@ -3,8 +3,8 @@
// 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_INDIRECT_ITERATOR_JAN_19_2011_0814PM)
#define SPIRIT_KARMA_INDIRECT_ITERATOR_JAN_19_2011_0814PM
#ifndef BOOST_SPIRIT_KARMA_DETAIL_INDIRECT_ITERATOR_HPP
#define BOOST_SPIRIT_KARMA_DETAIL_INDIRECT_ITERATOR_HPP
#if defined(_MSC_VER)
#pragma once

View File

@@ -191,7 +191,7 @@ namespace boost { namespace spirit { namespace karma { namespace detail
// 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(_WIN32) || defined(__CYGWIN__)) && defined(BOOST_SPIRIT_UNICODE)
#if (defined(_MSC_VER) || defined(__SIZEOF_WCHAR_T__) && __SIZEOF_WCHAR_T__ == 2) && defined(BOOST_SPIRIT_UNICODE)
typedef spirit::char_encoding::unicode::char_type buffer_char_type;
#else
typedef wchar_t buffer_char_type;
@@ -237,9 +237,12 @@ namespace boost { namespace spirit { namespace karma { namespace detail
buffer.begin() + (std::min)(buffer.size(), maxwidth);
#if defined(BOOST_MSVC)
#pragma warning(pop)
#pragma warning(disable: 4244) // conversion from 'x' to 'y', possible loss of data
#endif
std::copy(buffer.begin(), end, sink);
#if defined(BOOST_MSVC)
#pragma warning(pop)
#endif
return true;
}
template <typename RestIterator>
@@ -253,9 +256,12 @@ namespace boost { namespace spirit { namespace karma { namespace detail
buffer.begin() + (std::min)(buffer.size(), start_at);
#if defined(BOOST_MSVC)
#pragma warning(pop)
#pragma warning(disable: 4244) // conversion from 'x' to 'y', possible loss of data
#endif
std::copy(begin, buffer.end(), sink);
#if defined(BOOST_MSVC)
#pragma warning(pop)
#endif
return true;
}
@@ -383,7 +389,7 @@ namespace boost { namespace spirit { namespace karma { namespace detail
, output_iterator<OutputIterator, Properties, Derived>
>::type most_derived_type;
enum { properties = Properties::value };
static const generator_properties::enum_type properties = static_cast<generator_properties::enum_type>(Properties::value);
typedef typename mpl::if_c<
(properties & generator_properties::tracking) ? true : false

View File

@@ -5,8 +5,8 @@
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_PASS_CONTAINER_MAR_15_2009_0114PM)
#define SPIRIT_PASS_CONTAINER_MAR_15_2009_0114PM
#ifndef BOOST_SPIRIT_KARMA_DETAIL_PASS_CONTAINER_HPP
#define BOOST_SPIRIT_KARMA_DETAIL_PASS_CONTAINER_HPP
#if defined(_MSC_VER)
#pragma once
@@ -23,11 +23,9 @@
#include <boost/mpl/or.hpp>
#include <boost/preprocessor/cat.hpp>
#include <boost/preprocessor/repetition/repeat.hpp>
#include <boost/range/iterator_range.hpp>
#include <boost/range/iterator_range_core.hpp>
#include <boost/fusion/include/deduce_sequence.hpp>
#include <boost/mpl/print.hpp>
namespace boost { namespace spirit { namespace karma { namespace detail
{
// Helper meta-function allowing to evaluate weak substitutability and
@@ -273,6 +271,10 @@ namespace boost { namespace spirit { namespace karma { namespace detail
mutable Iterator end;
};
#ifdef _MSC_VER
# pragma warning(push)
# pragma warning(disable: 4512) // assignment operator could not be generated.
#endif
template <typename Iterator>
struct pass_container_base<Iterator&>
{
@@ -382,11 +384,10 @@ namespace boost { namespace spirit { namespace karma { namespace detail
}
F f;
private:
// silence MSVC warning C4512: assignment operator could not be generated
pass_container& operator= (pass_container const&);
};
#ifdef _MSC_VER
# pragma warning(pop)
#endif
}}}}
#endif

View File

@@ -10,10 +10,8 @@
#pragma once
#endif
#include <string>
#include <boost/spirit/home/support/char_class.hpp>
#include <boost/spirit/home/karma/detail/generate_to.hpp>
#include <boost/range/iterator_range.hpp>
namespace boost { namespace spirit { namespace karma { namespace detail
{

View File

@@ -10,10 +10,10 @@
#pragma once
#endif
#include <string>
#include <boost/spirit/home/support/char_class.hpp>
#include <boost/spirit/home/karma/detail/generate_to.hpp>
#include <boost/range/const_iterator.hpp>
#include <boost/range/begin.hpp>
#include <boost/range/end.hpp>
namespace boost { namespace spirit { namespace karma { namespace detail
{

View File

@@ -14,17 +14,20 @@
namespace boost { namespace spirit { namespace karma { namespace detail
{
#ifdef _MSC_VER
# pragma warning(push)
# pragma warning(disable: 4512) // assignment operator could not be generated.
#endif
template <typename Delimiter>
struct unused_delimiter : unused_type
{
unused_delimiter(Delimiter const& delim)
: delimiter(delim) {}
Delimiter const& delimiter;
private:
// silence MSVC warning C4512: assignment operator could not be generated
unused_delimiter& operator= (unused_delimiter const&);
};
#ifdef _MSC_VER
# pragma warning(pop)
#endif
// If a surrounding verbatim[] directive was specified, the current
// delimiter is of the type unused_delimiter. In this case we

View File

@@ -4,8 +4,8 @@
// 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_AS_DEC_18_0510PM)
#define SPIRIT_KARMA_AS_DEC_18_0510PM
#ifndef BOOST_SPIRIT_KARMA_DIRECTIVE_AS_HPP
#define BOOST_SPIRIT_KARMA_DIRECTIVE_AS_HPP
#if defined(_MSC_VER)
#pragma once
@@ -13,6 +13,7 @@
#include <boost/spirit/home/karma/meta_compiler.hpp>
#include <boost/spirit/home/karma/generator.hpp>
#include <boost/spirit/home/karma/delimit_out.hpp>
#include <boost/spirit/home/karma/domain.hpp>
#include <boost/spirit/home/karma/detail/output_iterator.hpp>
#include <boost/spirit/home/karma/detail/as.hpp>

View File

@@ -3,8 +3,8 @@
// 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_BUFFER_AUG_03_2009_0949AM)
#define SPIRIT_KARMA_BUFFER_AUG_03_2009_0949AM
#ifndef BOOST_SPIRIT_KARMA_DIRECTIVE_BUFFER_HPP
#define BOOST_SPIRIT_KARMA_DIRECTIVE_BUFFER_HPP
#if defined(_MSC_VER)
#pragma once

View File

@@ -17,6 +17,7 @@
#include <boost/spirit/home/karma/detail/default_width.hpp>
#include <boost/spirit/home/karma/delimit_out.hpp>
#include <boost/spirit/home/karma/auxiliary/lazy.hpp>
#include <boost/spirit/home/karma/char/char.hpp>
#include <boost/spirit/home/support/unused.hpp>
#include <boost/spirit/home/support/common_terminals.hpp>
#include <boost/spirit/home/support/has_semantic_action.hpp>
@@ -92,7 +93,7 @@ namespace boost { namespace spirit { namespace karma
unsigned int const width, Padding const& p)
{
#if BOOST_WORKAROUND(BOOST_MSVC, BOOST_TESTED_AT(1600))
e; // suppresses warning: C4100: 'e' : unreferenced formal parameter
(void)e; // suppresses warning: C4100: 'e' : unreferenced formal parameter
#endif
// wrap the given output iterator to allow left padding
detail::enable_buffering<OutputIterator> buffering(sink, width);

View File

@@ -70,6 +70,10 @@ namespace boost { namespace spirit { namespace karma
namespace detail
{
#ifdef _MSC_VER
# pragma warning(push)
# pragma warning(disable: 4512) // assignment operator could not be generated.
#endif
template <typename Delimiter, typename ColumnDelimiter>
struct columns_delimiter
{
@@ -108,11 +112,10 @@ namespace boost { namespace spirit { namespace karma
ColumnDelimiter const& column_delimiter;
unsigned int const numcolumns;
mutable unsigned int count;
private:
// silence MSVC warning C4512: assignment operator could not be generated
columns_delimiter& operator= (columns_delimiter const&);
};
#ifdef _MSC_VER
# pragma warning(pop)
#endif
}
///////////////////////////////////////////////////////////////////////////

View File

@@ -16,6 +16,7 @@
#include <boost/spirit/home/karma/detail/unused_delimiter.hpp>
#include <boost/spirit/home/karma/delimit_out.hpp>
#include <boost/spirit/home/karma/auxiliary/lazy.hpp>
#include <boost/spirit/home/karma/char/char.hpp>
#include <boost/spirit/home/support/unused.hpp>
#include <boost/spirit/home/support/common_terminals.hpp>
#include <boost/spirit/home/support/has_semantic_action.hpp>

View File

@@ -3,8 +3,8 @@
// 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_DUPLICATE_JUL_11_2010_0954AM)
#define SPIRIT_KARMA_DUPLICATE_JUL_11_2010_0954AM
#ifndef BOOST_SPIRIT_KARMA_DIRECTIVE_DUPLICATE_HPP
#define BOOST_SPIRIT_KARMA_DIRECTIVE_DUPLICATE_HPP
#if defined(_MSC_VER)
#pragma once

View File

@@ -4,8 +4,8 @@
// 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_ENCODING_MARCH_05_2010_0550PM)
#define SPIRIT_KARMA_ENCODING_MARCH_05_2010_0550PM
#ifndef BOOST_SPIRIT_KARMA_DIRECTIVE_ENCODING_HPP
#define BOOST_SPIRIT_KARMA_DIRECTIVE_ENCODING_HPP
#if defined(_MSC_VER)
#pragma once

View File

@@ -17,6 +17,7 @@
#include <boost/spirit/home/karma/detail/default_width.hpp>
#include <boost/spirit/home/karma/delimit_out.hpp>
#include <boost/spirit/home/karma/auxiliary/lazy.hpp>
#include <boost/spirit/home/karma/char/char.hpp>
#include <boost/spirit/home/support/unused.hpp>
#include <boost/spirit/home/support/common_terminals.hpp>
#include <boost/spirit/home/karma/detail/attributes.hpp>
@@ -92,7 +93,7 @@ namespace boost { namespace spirit { namespace karma
unsigned int const width, Padding const& p)
{
#if BOOST_WORKAROUND(BOOST_MSVC, BOOST_TESTED_AT(1600))
e; // suppresses warning: C4100: 'e' : unreferenced formal parameter
(void)e; // suppresses warning: C4100: 'e' : unreferenced formal parameter
#endif
// wrap the given output iterator to allow counting
detail::enable_counting<OutputIterator> counting(sink);

View File

@@ -105,7 +105,7 @@ namespace boost { namespace spirit { namespace karma
unsigned int const maxwidth, Rest& restdest)
{
#if BOOST_WORKAROUND(BOOST_MSVC, BOOST_TESTED_AT(1600))
e; // suppresses warning: C4100: 'e' : unreferenced formal parameter
(void)e; // suppresses warning: C4100: 'e' : unreferenced formal parameter
#endif
// wrap the given output iterator to allow buffering, but disable
// counting

View File

@@ -3,8 +3,8 @@
// 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_OMIT_JUL_20_2009_1008AM)
#define SPIRIT_KARMA_OMIT_JUL_20_2009_1008AM
#ifndef BOOST_SPIRIT_KARMA_DIRECTIVE_OMIT_HPP
#define BOOST_SPIRIT_KARMA_DIRECTIVE_OMIT_HPP
#if defined(_MSC_VER)
#pragma once
@@ -19,6 +19,7 @@
#include <boost/spirit/home/support/has_semantic_action.hpp>
#include <boost/spirit/home/support/handles_container.hpp>
#include <boost/spirit/home/karma/detail/attributes.hpp>
#include <boost/spirit/home/karma/detail/output_iterator.hpp>
namespace boost { namespace spirit
{
@@ -73,8 +74,15 @@ namespace boost { namespace spirit { namespace karma
// have any other means to verify, whether the passed attribute is
// compatible with the subject.
#if defined(_MSC_VER) && _MSC_VER < 1900
# pragma warning(push)
# pragma warning(disable: 4127) // conditional expression is constant
#endif
// omit[] will execute the code, while skip[] doesn't execute it
if (Execute) {
#if defined(_MSC_VER) && _MSC_VER < 1900
# pragma warning(pop)
#endif
// wrap the given output iterator to avoid output
detail::disable_output<OutputIterator> disable(sink);
return subject.generate(sink, ctx, d, attr);

View File

@@ -4,8 +4,8 @@
// 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_REPEAT_MAY_18_2009_0926AM)
#define SPIRIT_KARMA_REPEAT_MAY_18_2009_0926AM
#ifndef BOOST_SPIRIT_KARMA_DIRECTIVE_REPEAT_HPP
#define BOOST_SPIRIT_KARMA_DIRECTIVE_REPEAT_HPP
#if defined(_MSC_VER)
#pragma once
@@ -77,6 +77,10 @@ namespace boost { namespace spirit { namespace karma
using spirit::inf_type;
///////////////////////////////////////////////////////////////////////////
#ifdef _MSC_VER
# pragma warning(push)
# pragma warning(disable: 4512) // assignment operator could not be generated.
#endif
// handles repeat(exact)[p]
template <typename T>
struct exact_iterator
@@ -90,10 +94,6 @@ namespace boost { namespace spirit { namespace karma
bool got_min(T i) const { return i >= exact; }
T const exact;
private:
// silence MSVC warning C4512: assignment operator could not be generated
exact_iterator& operator= (exact_iterator const&);
};
// handles repeat(min, max)[p]
@@ -111,10 +111,6 @@ namespace boost { namespace spirit { namespace karma
T const min;
T const max;
private:
// silence MSVC warning C4512: assignment operator could not be generated
finite_iterator& operator= (finite_iterator const&);
};
// handles repeat(min, inf)[p]
@@ -130,11 +126,10 @@ namespace boost { namespace spirit { namespace karma
bool got_min(T i) const { return i >= min; }
T const min;
private:
// silence MSVC warning C4512: assignment operator could not be generated
infinite_iterator& operator= (infinite_iterator const&);
};
#ifdef _MSC_VER
# pragma warning(pop)
#endif
///////////////////////////////////////////////////////////////////////////
template <typename Subject, typename LoopIter, typename Strict

View File

@@ -17,6 +17,7 @@
#include <boost/spirit/home/karma/detail/default_width.hpp>
#include <boost/spirit/home/karma/delimit_out.hpp>
#include <boost/spirit/home/karma/auxiliary/lazy.hpp>
#include <boost/spirit/home/karma/char/char.hpp>
#include <boost/spirit/home/support/unused.hpp>
#include <boost/spirit/home/support/common_terminals.hpp>
#include <boost/spirit/home/support/has_semantic_action.hpp>
@@ -92,7 +93,7 @@ namespace boost { namespace spirit { namespace karma
unsigned int const width, Padding const& p)
{
#if BOOST_WORKAROUND(BOOST_MSVC, BOOST_TESTED_AT(1600))
e; // suppresses warning: C4100: 'e' : unreferenced formal parameter
(void)e; // suppresses warning: C4100: 'e' : unreferenced formal parameter
#endif
// wrap the given output iterator to allow left padding
detail::enable_buffering<OutputIterator> buffering(sink, width);

View File

@@ -3,8 +3,8 @@
// 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_STRICT_RELAXED_APR_22_2010_0959AM)
#define SPIRIT_STRICT_RELAXED_APR_22_2010_0959AM
#ifndef BOOST_SPIRIT_KARMA_DIRECTIVE_STRICT_RELAXED_HPP
#define BOOST_SPIRIT_KARMA_DIRECTIVE_STRICT_RELAXED_HPP
#if defined(_MSC_VER)
#pragma once

View File

@@ -4,8 +4,8 @@
// 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_UPPER_LOWER_CASE_JANUARY_19_2009_1142AM)
#define SPIRIT_UPPER_LOWER_CASE_JANUARY_19_2009_1142AM
#ifndef BOOST_SPIRIT_KARMA_DIRECTIVE_UPPER_LOWER_CASE_HPP
#define BOOST_SPIRIT_KARMA_DIRECTIVE_UPPER_LOWER_CASE_HPP
#if defined(_MSC_VER)
#pragma once

View File

@@ -15,6 +15,7 @@
#include <boost/spirit/home/karma/domain.hpp>
#include <boost/spirit/home/karma/generator.hpp>
#include <boost/spirit/home/support/string_traits.hpp>
#include <boost/proto/tags.hpp>
#include <boost/type_traits/remove_reference.hpp>
#include <boost/utility/enable_if.hpp>
#include <boost/fusion/include/at.hpp>

View File

@@ -15,10 +15,6 @@
#include <boost/spirit/home/karma/nonterminal/rule.hpp>
#include <boost/spirit/home/karma/nonterminal/debug_handler_state.hpp>
#include <boost/function.hpp>
#include <boost/fusion/include/at.hpp>
#include <boost/fusion/include/vector.hpp>
#include <boost/fusion/include/out.hpp>
#include <iostream>
namespace boost { namespace spirit { namespace karma
{

View File

@@ -19,6 +19,8 @@
#include <boost/spirit/home/karma/nonterminal/nonterminal_fwd.hpp>
#include <boost/spirit/home/karma/reference.hpp>
#include <boost/noncopyable.hpp>
#include <boost/proto/extends.hpp>
#include <boost/proto/traits.hpp>
#include <boost/type_traits/is_same.hpp>
namespace boost { namespace spirit { namespace karma

View File

@@ -15,8 +15,6 @@
#include <boost/config.hpp>
#include <boost/function.hpp>
#include <boost/mpl/vector.hpp>
#include <boost/type_traits/add_const.hpp>
#include <boost/type_traits/add_reference.hpp>
#include <boost/type_traits/is_same.hpp>
#include <boost/fusion/include/vector.hpp>
@@ -40,6 +38,12 @@
#include <boost/spirit/home/karma/nonterminal/detail/generator_binder.hpp>
#include <boost/spirit/home/karma/nonterminal/detail/parameterized.hpp>
#include <boost/static_assert.hpp>
#include <boost/proto/extends.hpp>
#include <boost/proto/traits.hpp>
#include <boost/type_traits/is_const.hpp>
#include <boost/type_traits/is_reference.hpp>
#if defined(BOOST_MSVC)
# pragma warning(push)
# pragma warning(disable: 4127) // conditional expression is constant
@@ -133,9 +137,10 @@ namespace boost { namespace spirit { namespace karma
typedef typename
spirit::detail::attr_from_sig<sig_type>::type
attr_type;
typedef typename add_reference<
typename add_const<attr_type>::type>::type
attr_reference_type;
BOOST_STATIC_ASSERT_MSG(
!is_reference<attr_type>::value && !is_const<attr_type>::value,
"Const/reference qualifiers on Karma rule attribute are meaningless");
typedef attr_type const& attr_reference_type;
// parameter_types is a sequence of types passed as parameters to the rule
typedef typename

View File

@@ -40,7 +40,7 @@ namespace boost { namespace spirit { namespace karma
call (OutputIterator& sink, U b, Policies const& p = Policies())
{
#if BOOST_WORKAROUND(BOOST_MSVC, BOOST_TESTED_AT(1600))
p; // suppresses warning: C4100: 'p' : unreferenced formal parameter
(void)p; // suppresses warning: C4100: 'p' : unreferenced formal parameter
#endif
return p.template call<bool_inserter>(sink, T(b), p);
}
@@ -53,7 +53,7 @@ namespace boost { namespace spirit { namespace karma
call_n (OutputIterator& sink, U b, Policies const& p)
{
#if BOOST_WORKAROUND(BOOST_MSVC, BOOST_TESTED_AT(1600))
p; // suppresses warning: C4100: 'p' : unreferenced formal parameter
(void)p; // suppresses warning: C4100: 'p' : unreferenced formal parameter
#endif
if (b)
return p.template generate_true<CharEncoding, Tag>(sink, b);

View File

@@ -14,16 +14,16 @@
#include <boost/config/no_tr1/cmath.hpp>
#include <boost/limits.hpp>
#include <boost/math/special_functions/fpclassify.hpp>
#include <boost/type_traits/is_integral.hpp>
#include <boost/spirit/home/support/char_class.hpp>
#include <boost/spirit/home/support/unused.hpp>
#include <boost/spirit/home/support/numeric_traits.hpp>
#include <boost/spirit/home/support/detail/pow10.hpp>
#include <boost/spirit/home/support/detail/sign.hpp>
#include <boost/spirit/home/karma/detail/generate_to.hpp>
#include <boost/spirit/home/karma/detail/string_generate.hpp>
#include <boost/core/cmath.hpp>
///////////////////////////////////////////////////////////////////////////////
//
// The value BOOST_KARMA_NUMERICS_LOOP_UNROLL specifies, how to unroll the
@@ -120,7 +120,7 @@ namespace boost { namespace spirit { namespace traits
typedef float type;
static type call(float n)
{
return (spirit::detail::signbit)(n) ? -n : n;
return (std::fabs)(n);
}
};
@@ -130,7 +130,7 @@ namespace boost { namespace spirit { namespace traits
typedef double type;
static type call(double n)
{
return (spirit::detail::signbit)(n) ? -n : n;
return (std::fabs)(n);
}
};
@@ -140,7 +140,7 @@ namespace boost { namespace spirit { namespace traits
typedef long double type;
static type call(long double n)
{
return (spirit::detail::signbit)(n) ? -n : n;
return (std::fabs)(n);
}
};
@@ -177,7 +177,7 @@ namespace boost { namespace spirit { namespace traits
{
static bool call(float n)
{
return (spirit::detail::signbit)(n) ? true : false;
return (core::signbit)(n) ? true : false;
}
};
@@ -186,7 +186,7 @@ namespace boost { namespace spirit { namespace traits
{
static bool call(double n)
{
return (spirit::detail::signbit)(n) ? true : false;
return (core::signbit)(n) ? true : false;
}
};
@@ -195,7 +195,7 @@ namespace boost { namespace spirit { namespace traits
{
static bool call(long double n)
{
return (spirit::detail::signbit)(n) ? true : false;
return (core::signbit)(n) ? true : false;
}
};
@@ -220,7 +220,7 @@ namespace boost { namespace spirit { namespace traits
{
static bool call(float n)
{
return (math::fpclassify)(n) == FP_ZERO;
return (core::fpclassify)(n) == core::fp_zero;
}
};
@@ -229,7 +229,7 @@ namespace boost { namespace spirit { namespace traits
{
static bool call(double n)
{
return (math::fpclassify)(n) == FP_ZERO;
return (core::fpclassify)(n) == core::fp_zero;
}
};
@@ -238,7 +238,7 @@ namespace boost { namespace spirit { namespace traits
{
static bool call(long double n)
{
return (math::fpclassify)(n) == FP_ZERO;
return (core::fpclassify)(n) == core::fp_zero;
}
};
@@ -264,7 +264,7 @@ namespace boost { namespace spirit { namespace traits
{
static bool call(float n)
{
return (math::fpclassify)(n) == FP_NAN;
return (core::fpclassify)(n) == core::fp_nan;
}
};
@@ -273,7 +273,7 @@ namespace boost { namespace spirit { namespace traits
{
static bool call(double n)
{
return (math::fpclassify)(n) == FP_NAN;
return (core::fpclassify)(n) == core::fp_nan;
}
};
@@ -282,7 +282,7 @@ namespace boost { namespace spirit { namespace traits
{
static bool call(long double n)
{
return (math::fpclassify)(n) == FP_NAN;
return (core::fpclassify)(n) == core::fp_nan;
}
};
@@ -298,9 +298,8 @@ namespace boost { namespace spirit { namespace traits
{
static bool call(T n)
{
if (!std::numeric_limits<T>::has_infinity)
return false;
return (n == std::numeric_limits<T>::infinity()) ? true : false;
return std::numeric_limits<T>::has_infinity
&& n == std::numeric_limits<T>::infinity();
}
};
@@ -309,7 +308,7 @@ namespace boost { namespace spirit { namespace traits
{
static bool call(float n)
{
return (math::fpclassify)(n) == FP_INFINITE;
return (core::fpclassify)(n) == core::fp_infinite;
}
};
@@ -318,7 +317,7 @@ namespace boost { namespace spirit { namespace traits
{
static bool call(double n)
{
return (math::fpclassify)(n) == FP_INFINITE;
return (core::fpclassify)(n) == core::fp_infinite;
}
};
@@ -327,7 +326,7 @@ namespace boost { namespace spirit { namespace traits
{
static bool call(long double n)
{
return (math::fpclassify)(n) == FP_INFINITE;
return (core::fpclassify)(n) == core::fp_infinite;
}
};
@@ -575,12 +574,12 @@ namespace boost { namespace spirit { namespace karma
///////////////////////////////////////////////////////////////////////////
#define BOOST_KARMA_NUMERICS_INNER_LOOP_PREFIX(z, x, data) \
if (!traits::test_zero(n)) { \
int ch = radix_type::call(remainder_type::call(n)); \
int ch_##x = radix_type::call(remainder_type::call(n)); \
n = divide_type::call(n, num, ++exp); \
/**/
#define BOOST_KARMA_NUMERICS_INNER_LOOP_SUFFIX(z, x, data) \
*sink = char(ch); \
#define BOOST_KARMA_NUMERICS_INNER_LOOP_SUFFIX(z, x, n_rolls_sub1) \
*sink = char(BOOST_PP_CAT(ch_, BOOST_PP_SUB(n_rolls_sub1, x))); \
++sink; \
} \
/**/
@@ -611,7 +610,8 @@ namespace boost { namespace spirit { namespace karma
BOOST_PP_REPEAT(
BOOST_KARMA_NUMERICS_LOOP_UNROLL,
BOOST_KARMA_NUMERICS_INNER_LOOP_SUFFIX, _);
BOOST_KARMA_NUMERICS_INNER_LOOP_SUFFIX,
BOOST_PP_DEC(BOOST_KARMA_NUMERICS_LOOP_UNROLL));
*sink = char(ch);
++sink;

View File

@@ -1,4 +1,4 @@
// Copyright (c) 2001-2011 Hartmut Kaiser
// Copyright (c) 2001-2020 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)
@@ -18,7 +18,6 @@
#include <boost/spirit/home/support/char_class.hpp>
#include <boost/spirit/home/support/unused.hpp>
#include <boost/spirit/home/support/detail/pow10.hpp>
#include <boost/spirit/home/support/detail/sign.hpp>
#include <boost/spirit/home/karma/detail/generate_to.hpp>
#include <boost/spirit/home/karma/detail/string_generate.hpp>
#include <boost/spirit/home/karma/numeric/detail/numeric_utils.hpp>
@@ -84,34 +83,37 @@ namespace boost { namespace spirit { namespace karma
// get correct precision for generated number
unsigned precision = p.precision(n);
if (std::numeric_limits<U>::digits10)
{
// limit generated precision to digits10, if defined
precision = (std::min)(precision,
(unsigned)std::numeric_limits<U>::digits10 + 1);
}
// allow for ADL to find the correct overloads for log10 et.al.
using namespace std;
bool precexp_offset = false;
U dim = 0;
if (0 == (Policies::fmtflags::fixed & flags) && !traits::test_zero(n))
{
dim = log10(n);
if (dim > 0)
if (dim > 0)
n /= spirit::traits::pow10<U>(traits::truncate_to_long::call(dim));
else if (n < 1.) {
long exp = traits::truncate_to_long::call(-dim);
if (exp != -dim)
++exp;
dim = static_cast<U>(-exp);
// detect and handle denormalized numbers to prevent overflow in pow10
if (exp > std::numeric_limits<U>::max_exponent10)
{
n *= spirit::traits::pow10<U>(std::numeric_limits<U>::max_exponent10);
n *= spirit::traits::pow10<U>(exp - std::numeric_limits<U>::max_exponent10);
} else
}
else
n *= spirit::traits::pow10<U>(exp);
if (n < 1.)
{
n *= 10.;
--dim;
precexp_offset = true;
}
}
}
@@ -120,14 +122,28 @@ namespace boost { namespace spirit { namespace karma
U precexp = spirit::traits::pow10<U>(precision);
U fractional_part = modf(n, &integer_part);
fractional_part = floor(fractional_part * precexp + U(0.5));
if (fractional_part >= precexp)
if (precexp_offset)
{
fractional_part =
floor((fractional_part * precexp + U(0.5)) * U(10.)) / U(10.);
}
else
{
fractional_part = floor(fractional_part * precexp + U(0.5));
}
if (fractional_part >= precexp)
{
fractional_part = floor(fractional_part - precexp);
integer_part += 1; // handle rounding overflow
if (integer_part >= 10. && 0 == (Policies::fmtflags::fixed & flags))
{
integer_part /= 10.;
++dim;
}
}
// if trailing zeros are to be omitted, normalize the precision and
// if trailing zeros are to be omitted, normalize the precision and``
// fractional part
U long_int_part = floor(integer_part);
U long_frac_part = fractional_part;

View File

@@ -11,7 +11,6 @@
#endif
#include <boost/config/no_tr1/cmath.hpp>
#include <boost/math/special_functions/fpclassify.hpp>
#include <boost/type_traits/remove_const.hpp>
#include <boost/spirit/home/support/char_class.hpp>
@@ -162,8 +161,7 @@ namespace boost { namespace spirit { namespace karma
//
// Note: If the trailing_zeros flag is not in effect additional
// comments apply. See the comment for the fraction_part()
// function below. Moreover, this precision will be limited
// to the value of std::numeric_limits<T>::digits10 + 1
// function below.
///////////////////////////////////////////////////////////////////////
static unsigned precision(T)
{
@@ -260,7 +258,7 @@ namespace boost { namespace spirit { namespace karma
// but it's spelled out to avoid inter-modular dependencies.
typename remove_const<T>::type digits =
(traits::test_zero(n) ? 0 : floor(log10(n))) + 1;
(traits::test_zero(n) ? 1 : ceil(log10(n + T(1.))));
bool r = true;
for (/**/; r && digits < precision_; digits = digits + 1)
r = char_inserter<>::call(sink, '0');

View File

@@ -4,8 +4,8 @@
// 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_ALTERNATIVE_MAR_01_2007_1117AM)
#define SPIRIT_KARMA_ALTERNATIVE_MAR_01_2007_1117AM
#ifndef BOOST_SPIRIT_KARMA_OPERATOR_ALTERNATIVE_HPP
#define BOOST_SPIRIT_KARMA_OPERATOR_ALTERNATIVE_HPP
#if defined(_MSC_VER)
#pragma once
@@ -26,6 +26,7 @@
#include <boost/fusion/include/for_each.hpp>
#include <boost/mpl/accumulate.hpp>
#include <boost/mpl/bitor.hpp>
#include <boost/proto/tags.hpp>
#include <boost/config.hpp>
namespace boost { namespace spirit

View File

@@ -4,8 +4,8 @@
// 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_AND_PREDICATE_MAR_22_2009_0412PM)
#define SPIRIT_KARMA_AND_PREDICATE_MAR_22_2009_0412PM
#ifndef BOOST_SPIRIT_KARMA_OPERATOR_AND_PREDICATE_HPP
#define BOOST_SPIRIT_KARMA_OPERATOR_AND_PREDICATE_HPP
#if defined(_MSC_VER)
#pragma once
@@ -19,6 +19,8 @@
#include <boost/spirit/home/support/info.hpp>
#include <boost/spirit/home/support/has_semantic_action.hpp>
#include <boost/spirit/home/support/handles_container.hpp>
#include <boost/proto/operators.hpp>
#include <boost/proto/tags.hpp>
namespace boost { namespace spirit
{

View File

@@ -24,7 +24,8 @@
#include <boost/spirit/home/support/container.hpp>
#include <boost/spirit/home/support/handles_container.hpp>
#include <boost/spirit/home/karma/detail/attributes.hpp>
#include <boost/proto/operators.hpp>
#include <boost/proto/tags.hpp>
#include <boost/type_traits/add_const.hpp>
namespace boost { namespace spirit

View File

@@ -4,8 +4,8 @@
// 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_LIST_MAY_01_2007_0229PM)
#define SPIRIT_KARMA_LIST_MAY_01_2007_0229PM
#ifndef BOOST_SPIRIT_KARMA_OPERATOR_LIST_HPP
#define BOOST_SPIRIT_KARMA_OPERATOR_LIST_HPP
#if defined(_MSC_VER)
#pragma once
@@ -24,6 +24,8 @@
#include <boost/spirit/home/support/container.hpp>
#include <boost/spirit/home/support/handles_container.hpp>
#include <boost/spirit/home/karma/detail/attributes.hpp>
#include <boost/proto/operators.hpp>
#include <boost/proto/tags.hpp>
namespace boost { namespace spirit
{

View File

@@ -4,8 +4,8 @@
// 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_NOT_PREDICATE_MAR_21_2009_1132AM)
#define SPIRIT_KARMA_NOT_PREDICATE_MAR_21_2009_1132AM
#ifndef BOOST_SPIRIT_KARMA_OPERATOR_NOT_PREDICATE_HPP
#define BOOST_SPIRIT_KARMA_OPERATOR_NOT_PREDICATE_HPP
#if defined(_MSC_VER)
#pragma once
@@ -19,6 +19,8 @@
#include <boost/spirit/home/support/info.hpp>
#include <boost/spirit/home/support/has_semantic_action.hpp>
#include <boost/spirit/home/support/handles_container.hpp>
#include <boost/proto/operators.hpp>
#include <boost/proto/tags.hpp>
namespace boost { namespace spirit
{

View File

@@ -4,8 +4,8 @@
// 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_OPTIONAL_MARCH_31_2007_0852AM)
#define SPIRIT_KARMA_OPTIONAL_MARCH_31_2007_0852AM
#ifndef BOOST_SPIRIT_KARMA_OPERATOR_OPTIONAL_HPP
#define BOOST_SPIRIT_KARMA_OPERATOR_OPTIONAL_HPP
#if defined(_MSC_VER)
#pragma once
@@ -22,6 +22,8 @@
#include <boost/spirit/home/support/handles_container.hpp>
#include <boost/mpl/assert.hpp>
#include <boost/optional.hpp>
#include <boost/proto/operators.hpp>
#include <boost/proto/tags.hpp>
#include <boost/type_traits/is_convertible.hpp>
namespace boost { namespace spirit

View File

@@ -25,7 +25,8 @@
#include <boost/spirit/home/support/has_semantic_action.hpp>
#include <boost/spirit/home/support/handles_container.hpp>
#include <boost/spirit/home/karma/detail/attributes.hpp>
#include <boost/proto/operators.hpp>
#include <boost/proto/tags.hpp>
#include <boost/type_traits/add_const.hpp>
namespace boost { namespace spirit

View File

@@ -4,8 +4,8 @@
// 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_SEQUENCE_FEB_28_2007_0247PM)
#define SPIRIT_KARMA_SEQUENCE_FEB_28_2007_0247PM
#ifndef BOOST_SPIRIT_KARMA_OPERATOR_SEQUENCE_HPP
#define BOOST_SPIRIT_KARMA_OPERATOR_SEQUENCE_HPP
#if defined(_MSC_VER)
#pragma once
@@ -37,6 +37,8 @@
#include <boost/mpl/not.hpp>
#include <boost/fusion/include/transform.hpp>
#include <boost/mpl/accumulate.hpp>
#include <boost/proto/operators.hpp>
#include <boost/proto/tags.hpp>
#include <boost/config.hpp>
///////////////////////////////////////////////////////////////////////////////

View File

@@ -10,18 +10,19 @@
#pragma once
#endif
#include <boost/spirit/include/version.hpp>
// we support Phoenix attributes only starting with V2.2
#if SPIRIT_VERSION >= 0x2020
#include <boost/spirit/home/karma/detail/attributes.hpp>
#include <boost/spirit/home/karma/detail/indirect_iterator.hpp>
#include <boost/spirit/home/support/container.hpp>
#include <boost/spirit/include/phoenix_core.hpp>
#include <boost/utility/result_of.hpp>
///////////////////////////////////////////////////////////////////////////////
namespace boost { namespace phoenix
{
template <typename Expr>
struct actor;
}}
///////////////////////////////////////////////////////////////////////////////
namespace boost { namespace spirit { namespace traits
{
@@ -121,4 +122,3 @@ namespace boost { namespace spirit { namespace traits
}}}
#endif
#endif

View File

@@ -20,6 +20,10 @@
namespace boost { namespace spirit { namespace karma { namespace detail
{
///////////////////////////////////////////////////////////////////////////
#ifdef _MSC_VER
# pragma warning(push)
# pragma warning(disable: 4512) // assignment operator could not be generated.
#endif
template <typename Expr
, typename CopyExpr = mpl::false_, typename CopyAttr = mpl::false_
, typename Delimiter = unused_type, typename Attribute = unused_type>
@@ -42,10 +46,6 @@ namespace boost { namespace spirit { namespace karma { namespace detail
Delimiter const& delim;
BOOST_SCOPED_ENUM(delimit_flag) const pre;
Attribute const& attr;
private:
// silence MSVC warning C4512: assignment operator could not be generated
format_manip& operator= (format_manip const&);
};
template <typename Expr, typename Delimiter, typename Attribute>
@@ -62,10 +62,6 @@ namespace boost { namespace spirit { namespace karma { namespace detail
Delimiter const& delim;
BOOST_SCOPED_ENUM(delimit_flag) const pre;
Attribute attr;
private:
// silence MSVC warning C4512: assignment operator could not be generated
format_manip& operator= (format_manip const&);
};
template <typename Expr, typename Delimiter, typename Attribute>
@@ -82,11 +78,10 @@ namespace boost { namespace spirit { namespace karma { namespace detail
Delimiter const& delim;
BOOST_SCOPED_ENUM(delimit_flag) const pre;
Attribute const& attr;
private:
// silence MSVC warning C4512: assignment operator could not be generated
format_manip& operator= (format_manip const&);
};
#ifdef _MSC_VER
# pragma warning(pop)
#endif
///////////////////////////////////////////////////////////////////////////
template <typename Expr, typename Enable = void>

View File

@@ -1,55 +0,0 @@
// Copyright (c) 2001-2011 Hartmut Kaiser
//
// Distributed under the Boost Software License, Version 1.0. (See accompanying
// file LICENSE_1_0.txt or copy at http://www.boist.org/LICENSE_1_0.txt)
#if !defined(BOOST_SPIRIT_ITERATOR_SINK_MAY_27_2007_0133PM)
#define BOOST_SPIRIT_ITERATOR_SINK_MAY_27_2007_0133PM
#if defined(_MSC_VER)
#pragma once
#endif
#include <boost/iostreams/stream.hpp>
#include <boost/spirit/home/karma/detail/generate_to.hpp>
///////////////////////////////////////////////////////////////////////////////
namespace boost { namespace spirit { namespace karma { namespace detail
{
///////////////////////////////////////////////////////////////////////////
template <
typename OutputIterator, typename Char, typename CharEncoding
, typename Tag
>
struct iterator_sink
{
typedef boost::iostreams::sink_tag category;
typedef Char char_type;
iterator_sink (OutputIterator& sink_)
: sink(sink_)
{}
// Write up to n characters from the buffer s to the output sequence,
// returning the number of characters written
std::streamsize write (Char const* s, std::streamsize n)
{
std::streamsize bytes_written = 0;
while (n--) {
if (!generate_to(sink, *s, CharEncoding(), Tag()))
break;
++s; ++bytes_written;
}
return bytes_written;
}
OutputIterator& sink;
private:
// silence MSVC warning C4512: assignment operator could not be generated
iterator_sink& operator= (iterator_sink const&);
};
}}}}
#endif

View File

@@ -21,7 +21,7 @@
#include <boost/spirit/home/karma/delimit_out.hpp>
#include <boost/spirit/home/karma/auxiliary/lazy.hpp>
#include <boost/spirit/home/karma/stream/detail/format_manip.hpp>
#include <boost/spirit/home/karma/stream/detail/iterator_sink.hpp>
#include <boost/spirit/home/karma/detail/generate_to.hpp>
#include <boost/spirit/home/karma/detail/get_casetag.hpp>
#include <boost/spirit/home/karma/detail/extract_from.hpp>
#include <boost/fusion/include/at.hpp>
@@ -29,8 +29,7 @@
#include <boost/fusion/include/cons.hpp>
#include <boost/utility/enable_if.hpp>
#include <boost/type_traits/is_same.hpp>
#include <iosfwd>
#include <ostream>
///////////////////////////////////////////////////////////////////////////////
namespace boost { namespace spirit
@@ -113,6 +112,36 @@ namespace boost { namespace spirit { namespace karma
using spirit::stream_type;
using spirit::wstream_type;
namespace detail
{
#ifdef _MSC_VER
# pragma warning(push)
# pragma warning(disable: 4512) // assignment operator could not be generated.
#endif
template <typename OutputIterator, typename Char, typename CharEncoding
, typename Tag>
struct psbuf : std::basic_streambuf<Char>
{
psbuf(OutputIterator& sink) : sink_(sink) {}
protected:
typename psbuf::int_type overflow(typename psbuf::int_type ch) BOOST_OVERRIDE
{
if (psbuf::traits_type::eq_int_type(ch, psbuf::traits_type::eof()))
return psbuf::traits_type::not_eof(ch);
return detail::generate_to(sink_, psbuf::traits_type::to_char_type(ch),
CharEncoding(), Tag()) ? ch : psbuf::traits_type::eof();
}
private:
OutputIterator& sink_;
};
#ifdef _MSC_VER
# pragma warning(pop)
#endif
}
///////////////////////////////////////////////////////////////////////////
template <typename Char, typename CharEncoding, typename Tag>
struct any_stream_generator
@@ -132,10 +161,6 @@ namespace boost { namespace spirit { namespace karma
static bool generate(OutputIterator& sink, Context& context
, Delimiter const& d, Attribute const& attr)
{
typedef karma::detail::iterator_sink<
OutputIterator, Char, CharEncoding, Tag
> sink_device;
if (!traits::has_optional_value(attr))
return false;
@@ -143,7 +168,8 @@ namespace boost { namespace spirit { namespace karma
typedef typename attribute<Context>::type attribute_type;
{
boost::iostreams::stream<sink_device> ostr(sink);
detail::psbuf<OutputIterator, Char, CharEncoding, Tag> pseudobuf(sink);
std::basic_ostream<Char> ostr(&pseudobuf);
ostr << traits::extract_from<attribute_type>(attr, context) << std::flush;
if (!ostr.good())
@@ -168,9 +194,6 @@ namespace boost { namespace spirit { namespace karma
typedef karma::detail::output_iterator<
karma::ostream_iterator<T, Char, Traits>, Properties
> output_iterator;
typedef karma::detail::iterator_sink<
output_iterator, Char, CharEncoding, Tag
> sink_device;
if (!traits::has_optional_value(attr))
return false;
@@ -179,7 +202,8 @@ namespace boost { namespace spirit { namespace karma
typedef typename attribute<Context>::type attribute_type;
{
boost::iostreams::stream<sink_device> ostr(sink);
detail::psbuf<output_iterator, Char, CharEncoding, Tag> pseudobuf(sink);
std::basic_ostream<Char> ostr(&pseudobuf);
ostr.imbue(sink.get_ostream().getloc());
ostr << traits::extract_from<attribute_type>(attr, context)
<< std::flush;
@@ -236,11 +260,8 @@ namespace boost { namespace spirit { namespace karma
bool generate(OutputIterator& sink, Context&, Delimiter const& d
, Attribute const&) const
{
typedef karma::detail::iterator_sink<
OutputIterator, Char, CharEncoding, Tag
> sink_device;
boost::iostreams::stream<sink_device> ostr(sink);
detail::psbuf<OutputIterator, Char, CharEncoding, Tag> pseudobuf(sink);
std::basic_ostream<Char> ostr(&pseudobuf);
ostr << t_ << std::flush; // use existing operator<<()
if (ostr.good())
@@ -261,12 +282,10 @@ namespace boost { namespace spirit { namespace karma
typedef karma::detail::output_iterator<
karma::ostream_iterator<T1, Char, Traits>, Properties
> output_iterator;
typedef karma::detail::iterator_sink<
output_iterator, Char, CharEncoding, Tag
> sink_device;
{
boost::iostreams::stream<sink_device> ostr(sink);
detail::psbuf<output_iterator, Char, CharEncoding, Tag> pseudobuf(sink);
std::basic_ostream<Char> ostr(&pseudobuf);
ostr.imbue(sink.get_ostream().getloc());
ostr << t_ << std::flush; // use existing operator<<()
@@ -284,10 +303,6 @@ namespace boost { namespace spirit { namespace karma
}
T t_;
private:
// silence MSVC warning C4512: assignment operator could not be generated
lit_stream_generator& operator= (lit_stream_generator const&);
};
///////////////////////////////////////////////////////////////////////////

View File

@@ -21,6 +21,8 @@
#include <boost/spirit/home/karma/detail/get_casetag.hpp>
#include <boost/spirit/home/karma/detail/string_generate.hpp>
#include <boost/config.hpp>
#include <boost/proto/extends.hpp>
#include <boost/proto/traits.hpp>
#include <boost/shared_ptr.hpp>
#include <boost/mpl/if.hpp>
#include <map>
@@ -383,6 +385,10 @@ namespace boost { namespace spirit { namespace karma
}
///////////////////////////////////////////////////////////////////////
#ifdef _MSC_VER
# pragma warning(push)
# pragma warning(disable: 4512) // assignment operator could not be generated.
#endif
struct adder
{
template <typename, typename = unused_type>
@@ -410,10 +416,6 @@ namespace boost { namespace spirit { namespace karma
}
symbols& sym;
private:
// silence MSVC warning C4512: assignment operator could not be generated
adder& operator= (adder const&);
};
struct remover
@@ -443,11 +445,10 @@ namespace boost { namespace spirit { namespace karma
}
symbols& sym;
private:
// silence MSVC warning C4512: assignment operator could not be generated
remover& operator= (remover const&);
};
#ifdef _MSC_VER
# pragma warning(pop)
#endif
adder add;
remover remove;
@@ -642,6 +643,10 @@ namespace boost { namespace spirit { namespace karma
}
///////////////////////////////////////////////////////////////////////
#ifdef _MSC_VER
# pragma warning(push)
# pragma warning(disable: 4512) // assignment operator could not be generated.
#endif
struct adder
{
template <typename, typename = unused_type>
@@ -669,10 +674,6 @@ namespace boost { namespace spirit { namespace karma
}
symbols& sym;
private:
// silence MSVC warning C4512: assignment operator could not be generated
adder& operator= (adder const&);
};
struct remover
@@ -702,11 +703,10 @@ namespace boost { namespace spirit { namespace karma
}
symbols& sym;
private:
// silence MSVC warning C4512: assignment operator could not be generated
remover& operator= (remover const&);
};
#ifdef _MSC_VER
# pragma warning(pop)
#endif
adder add;
remover remove;

View File

@@ -13,13 +13,13 @@
#pragma once
#endif
#include <boost/spirit/include/phoenix_core.hpp>
#include <boost/spirit/include/phoenix_operator.hpp>
#include <boost/spirit/home/support/string_traits.hpp>
#include <boost/spirit/home/lex/argument_phoenix.hpp>
#include <boost/fusion/include/at.hpp>
#include <boost/mpl/at.hpp>
#include <boost/mpl/bool.hpp>
#include <boost/phoenix/core/actor.hpp>
#include <boost/phoenix/core/argument.hpp>
#include <boost/type_traits/is_same.hpp>
#include <boost/type_traits/remove_const.hpp>
#include <boost/type_traits/remove_reference.hpp>

Some files were not shown because too many files have changed in this diff Show More