summaryrefslogtreecommitdiff
path: root/boost/spirit/home
diff options
context:
space:
mode:
Diffstat (limited to 'boost/spirit/home')
-rw-r--r--boost/spirit/home/classic/core/scanner/scanner.hpp5
-rw-r--r--boost/spirit/home/classic/error_handling/exceptions.hpp6
-rw-r--r--boost/spirit/home/classic/iterator/impl/position_iterator.ipp18
-rw-r--r--boost/spirit/home/classic/iterator/multi_pass.hpp17
-rw-r--r--boost/spirit/home/classic/iterator/position_iterator_fwd.hpp6
-rw-r--r--boost/spirit/home/classic/tree/common.hpp5
-rw-r--r--boost/spirit/home/classic/utility/regex.hpp4
-rw-r--r--boost/spirit/home/classic/version.hpp13
-rw-r--r--boost/spirit/home/karma/action/action.hpp6
-rw-r--r--boost/spirit/home/karma/binary/binary.hpp28
-rw-r--r--boost/spirit/home/karma/detail/attributes.hpp26
-rw-r--r--boost/spirit/home/karma/detail/indirect_iterator.hpp9
-rw-r--r--boost/spirit/home/karma/directive/center_alignment.hpp1
-rw-r--r--boost/spirit/home/karma/directive/left_alignment.hpp1
-rw-r--r--boost/spirit/home/karma/directive/maxwidth.hpp1
-rw-r--r--boost/spirit/home/karma/directive/right_alignment.hpp1
-rw-r--r--boost/spirit/home/karma/nonterminal/rule.hpp16
-rw-r--r--boost/spirit/home/lex/lexer/lexer.hpp16
-rw-r--r--boost/spirit/home/lex/lexer/lexertl/functor.hpp4
-rw-r--r--boost/spirit/home/lex/lexer/lexertl/functor_data.hpp3
-rw-r--r--boost/spirit/home/lex/lexer/lexertl/generate_static.hpp6
-rw-r--r--boost/spirit/home/lex/lexer/lexertl/iterator_tokenizer.hpp9
-rw-r--r--boost/spirit/home/lex/lexer/lexertl/lexer.hpp5
-rw-r--r--boost/spirit/home/lex/lexer/lexertl/position_token.hpp1
-rw-r--r--boost/spirit/home/lex/lexer/lexertl/static_functor_data.hpp3
-rw-r--r--boost/spirit/home/lex/lexer/lexertl/static_lexer.hpp4
-rw-r--r--boost/spirit/home/lex/lexer/lexertl/token.hpp1
-rw-r--r--boost/spirit/home/lex/lexer/token_def.hpp4
-rw-r--r--boost/spirit/home/lex/qi/plain_raw_token.hpp3
-rw-r--r--boost/spirit/home/lex/qi/plain_token.hpp5
-rw-r--r--boost/spirit/home/lex/qi/plain_tokenid.hpp5
-rw-r--r--boost/spirit/home/lex/qi/plain_tokenid_mask.hpp3
-rw-r--r--boost/spirit/home/qi/action/action.hpp15
-rw-r--r--boost/spirit/home/qi/auxiliary/attr_cast.hpp2
-rw-r--r--boost/spirit/home/qi/binary/binary.hpp28
-rw-r--r--boost/spirit/home/qi/detail/alternative_function.hpp4
-rw-r--r--boost/spirit/home/qi/detail/attributes.hpp44
-rw-r--r--boost/spirit/home/qi/detail/expectation_failure.hpp2
-rw-r--r--boost/spirit/home/qi/nonterminal/rule.hpp40
-rw-r--r--boost/spirit/home/qi/numeric/detail/numeric_utils.hpp66
-rw-r--r--boost/spirit/home/qi/numeric/detail/real_impl.hpp30
-rw-r--r--boost/spirit/home/qi/numeric/real_policies.hpp19
-rw-r--r--boost/spirit/home/qi/stream/detail/iterator_source.hpp19
-rw-r--r--boost/spirit/home/qi/string/detail/tst.hpp8
-rw-r--r--boost/spirit/home/qi/string/symbols.hpp5
-rw-r--r--boost/spirit/home/support/attributes.hpp115
-rw-r--r--boost/spirit/home/support/attributes_fwd.hpp3
-rw-r--r--boost/spirit/home/support/container.hpp4
-rw-r--r--boost/spirit/home/support/detail/endian/endian.hpp53
-rw-r--r--boost/spirit/home/support/detail/hold_any.hpp2
-rw-r--r--boost/spirit/home/support/detail/lexer/generate_cpp.hpp1
-rw-r--r--boost/spirit/home/support/detail/lexer/input.hpp4
-rw-r--r--boost/spirit/home/support/detail/lexer/serialise.hpp35
-rw-r--r--boost/spirit/home/support/iterators/detail/buf_id_check_policy.hpp6
-rw-r--r--boost/spirit/home/support/iterators/detail/buffering_input_iterator_policy.hpp12
-rw-r--r--boost/spirit/home/support/iterators/detail/input_iterator_policy.hpp12
-rw-r--r--boost/spirit/home/support/numeric_traits.hpp11
-rw-r--r--boost/spirit/home/support/utree/detail/utree_detail2.hpp14
-rw-r--r--boost/spirit/home/support/utree/operators.hpp7
-rw-r--r--boost/spirit/home/support/utree/utree.hpp9
-rw-r--r--boost/spirit/home/support/utree/utree_traits.hpp16
-rw-r--r--boost/spirit/home/x3/binary/binary.hpp1
-rw-r--r--boost/spirit/home/x3/core/action.hpp8
-rw-r--r--boost/spirit/home/x3/core/detail/parse_into_container.hpp6
-rw-r--r--boost/spirit/home/x3/directive/expect.hpp2
-rw-r--r--boost/spirit/home/x3/nonterminal/detail/rule.hpp13
-rw-r--r--boost/spirit/home/x3/nonterminal/detail/transform_attribute.hpp32
-rw-r--r--boost/spirit/home/x3/nonterminal/rule.hpp46
-rw-r--r--boost/spirit/home/x3/nonterminal/simple_trace.hpp6
-rw-r--r--boost/spirit/home/x3/numeric/real_policies.hpp19
-rw-r--r--boost/spirit/home/x3/operator/detail/sequence.hpp97
-rw-r--r--boost/spirit/home/x3/operator/optional.hpp2
-rw-r--r--boost/spirit/home/x3/string/detail/tst.hpp9
-rw-r--r--boost/spirit/home/x3/string/symbols.hpp84
-rw-r--r--boost/spirit/home/x3/support/ast/position_tagged.hpp4
-rw-r--r--boost/spirit/home/x3/support/ast/variant.hpp7
-rw-r--r--boost/spirit/home/x3/support/numeric_utils/detail/extract_int.hpp49
-rw-r--r--boost/spirit/home/x3/support/numeric_utils/extract_real.hpp28
-rw-r--r--boost/spirit/home/x3/support/subcontext.hpp1
-rw-r--r--boost/spirit/home/x3/support/traits/attribute_category.hpp1
-rw-r--r--boost/spirit/home/x3/support/traits/container_traits.hpp7
-rw-r--r--boost/spirit/home/x3/support/traits/make_attribute.hpp82
-rw-r--r--boost/spirit/home/x3/support/traits/move_to.hpp1
-rw-r--r--boost/spirit/home/x3/support/traits/numeric_traits.hpp11
-rw-r--r--boost/spirit/home/x3/support/traits/transform_attribute.hpp15
-rw-r--r--boost/spirit/home/x3/support/traits/value_traits.hpp4
-rw-r--r--boost/spirit/home/x3/support/traits/variant_find_substitute.hpp5
-rw-r--r--boost/spirit/home/x3/support/traits/variant_has_substitute.hpp5
-rw-r--r--boost/spirit/home/x3/support/unused.hpp4
-rw-r--r--boost/spirit/home/x3/support/utility/testing.hpp2
-rw-r--r--boost/spirit/home/x3/version.hpp2
91 files changed, 455 insertions, 919 deletions
diff --git a/boost/spirit/home/classic/core/scanner/scanner.hpp b/boost/spirit/home/classic/core/scanner/scanner.hpp
index 38548770eb..48938dbeed 100644
--- a/boost/spirit/home/classic/core/scanner/scanner.hpp
+++ b/boost/spirit/home/classic/core/scanner/scanner.hpp
@@ -13,7 +13,6 @@
#include <boost/spirit/home/classic/namespace.hpp>
#include <boost/spirit/home/classic/core/match.hpp>
#include <boost/spirit/home/classic/core/non_terminal/parser_id.hpp>
-#include <boost/detail/iterator.hpp> // for boost::detail::iterator_traits
#include <boost/spirit/home/classic/core/scanner/scanner_fwd.hpp>
@@ -219,9 +218,9 @@ BOOST_SPIRIT_CLASSIC_NAMESPACE_BEGIN
typedef IteratorT iterator_t;
typedef PoliciesT policies_t;
- typedef typename boost::detail::
+ typedef typename std::
iterator_traits<IteratorT>::value_type value_t;
- typedef typename boost::detail::
+ typedef typename std::
iterator_traits<IteratorT>::reference ref_t;
typedef typename boost::
call_traits<IteratorT>::param_type iter_param_t;
diff --git a/boost/spirit/home/classic/error_handling/exceptions.hpp b/boost/spirit/home/classic/error_handling/exceptions.hpp
index 224ac468ca..947d7a7b62 100644
--- a/boost/spirit/home/classic/error_handling/exceptions.hpp
+++ b/boost/spirit/home/classic/error_handling/exceptions.hpp
@@ -39,7 +39,7 @@ BOOST_SPIRIT_CLASSIC_NAMESPACE_BEGIN
protected:
parser_error_base() {}
- virtual ~parser_error_base() throw() {}
+ virtual ~parser_error_base() BOOST_NOEXCEPT_OR_NOTHROW {}
public:
@@ -87,10 +87,10 @@ BOOST_SPIRIT_CLASSIC_NAMESPACE_BEGIN
}
virtual
- ~parser_error() throw() {}
+ ~parser_error() BOOST_NOEXCEPT_OR_NOTHROW {}
virtual const char*
- what() const throw()
+ what() const BOOST_NOEXCEPT_OR_NOTHROW
{
return "BOOST_SPIRIT_CLASSIC_NS::parser_error";
}
diff --git a/boost/spirit/home/classic/iterator/impl/position_iterator.ipp b/boost/spirit/home/classic/iterator/impl/position_iterator.ipp
index d473af1a4b..6c24e356e6 100644
--- a/boost/spirit/home/classic/iterator/impl/position_iterator.ipp
+++ b/boost/spirit/home/classic/iterator/impl/position_iterator.ipp
@@ -17,7 +17,7 @@
#include <boost/mpl/if.hpp>
#include <boost/type_traits/is_same.hpp>
#include <boost/spirit/home/classic/core/nil.hpp> // for nil_t
-#include <boost/detail/iterator.hpp> // for boost::detail::iterator_traits
+#include <iterator> // for std::iterator_traits
namespace boost { namespace spirit {
@@ -91,6 +91,16 @@ private:
/* namespace boost::spirit { */ namespace iterator_ { namespace impl {
+template <typename T>
+struct make_const : boost::add_const<T>
+{};
+
+template <typename T>
+struct make_const<T&>
+{
+ typedef typename boost::add_const<T>::type& type;
+};
+
///////////////////////////////////////////////////////////////////////////////
//
// position_iterator_base_generator
@@ -104,9 +114,10 @@ template <typename MainIterT, typename ForwardIterT, typename PositionT>
struct position_iterator_base_generator
{
private:
- typedef boost::detail::iterator_traits<ForwardIterT> traits;
+ typedef std::iterator_traits<ForwardIterT> traits;
typedef typename traits::value_type value_type;
typedef typename traits::iterator_category iter_category_t;
+ typedef typename traits::reference reference;
// Position iterator is always a non-mutable iterator
typedef typename boost::add_const<value_type>::type const_value_type;
@@ -125,7 +136,8 @@ public:
main_iter_t,
ForwardIterT,
const_value_type,
- boost::forward_traversal_tag
+ boost::forward_traversal_tag,
+ typename make_const<reference>::type
> type;
};
diff --git a/boost/spirit/home/classic/iterator/multi_pass.hpp b/boost/spirit/home/classic/iterator/multi_pass.hpp
index a4ab6c202e..97c6757cf3 100644
--- a/boost/spirit/home/classic/iterator/multi_pass.hpp
+++ b/boost/spirit/home/classic/iterator/multi_pass.hpp
@@ -20,7 +20,6 @@
#include <boost/spirit/home/classic/namespace.hpp>
#include <boost/spirit/home/classic/core/assert.hpp> // for BOOST_SPIRIT_ASSERT
#include <boost/spirit/home/classic/iterator/fixed_size_queue.hpp>
-#include <boost/detail/iterator.hpp> // for boost::detail::iterator_traits
#include <boost/spirit/home/classic/iterator/multi_pass_fwd.hpp>
@@ -150,11 +149,11 @@ class BOOST_SYMBOL_VISIBLE illegal_backtracking : public std::exception
{
public:
- illegal_backtracking() throw() {}
- ~illegal_backtracking() throw() {}
+ illegal_backtracking() BOOST_NOEXCEPT_OR_NOTHROW {}
+ ~illegal_backtracking() BOOST_NOEXCEPT_OR_NOTHROW {}
virtual const char*
- what() const throw()
+ what() const BOOST_NOEXCEPT_OR_NOTHROW
{ return "BOOST_SPIRIT_CLASSIC_NS::illegal_backtracking"; }
};
@@ -491,7 +490,7 @@ class inner
{
private:
typedef
- typename boost::detail::iterator_traits<InputT>::value_type
+ typename std::iterator_traits<InputT>::value_type
result_type;
public:
@@ -516,13 +515,13 @@ class inner
public:
typedef
- typename boost::detail::iterator_traits<InputT>::difference_type
+ typename std::iterator_traits<InputT>::difference_type
difference_type;
typedef
- typename boost::detail::iterator_traits<InputT>::pointer
+ typename std::iterator_traits<InputT>::pointer
pointer;
typedef
- typename boost::detail::iterator_traits<InputT>::reference
+ typename std::iterator_traits<InputT>::reference
reference;
protected:
@@ -550,7 +549,7 @@ class inner
}
typedef
- typename boost::detail::iterator_traits<InputT>::value_type
+ typename std::iterator_traits<InputT>::value_type
value_t;
void swap(inner& x)
{
diff --git a/boost/spirit/home/classic/iterator/position_iterator_fwd.hpp b/boost/spirit/home/classic/iterator/position_iterator_fwd.hpp
index f194e24cab..8b0ff6addb 100644
--- a/boost/spirit/home/classic/iterator/position_iterator_fwd.hpp
+++ b/boost/spirit/home/classic/iterator/position_iterator_fwd.hpp
@@ -10,7 +10,7 @@
#define BOOST_SPIRIT_POSITION_ITERATOR_FWD_HPP
#include <string>
-#include <boost/detail/iterator.hpp> // for boost::detail::iterator_traits
+#include <iterator> // for std::iterator_traits
#include <boost/spirit/home/classic/namespace.hpp>
#include <boost/spirit/home/classic/core/nil.hpp>
@@ -32,7 +32,7 @@ BOOST_SPIRIT_CLASSIC_NAMESPACE_BEGIN
typename ForwardIteratorT,
typename PositionT = file_position_base<
std::basic_string<
- typename boost::detail::iterator_traits<ForwardIteratorT>::value_type
+ typename std::iterator_traits<ForwardIteratorT>::value_type
>
>,
typename SelfT = nil_t
@@ -44,7 +44,7 @@ BOOST_SPIRIT_CLASSIC_NAMESPACE_BEGIN
typename ForwardIteratorT,
typename PositionT = file_position_base<
std::basic_string<
- typename boost::detail::iterator_traits<ForwardIteratorT>::value_type
+ typename std::iterator_traits<ForwardIteratorT>::value_type
>
>
>
diff --git a/boost/spirit/home/classic/tree/common.hpp b/boost/spirit/home/classic/tree/common.hpp
index c086ff48d5..3ef9fea8f6 100644
--- a/boost/spirit/home/classic/tree/common.hpp
+++ b/boost/spirit/home/classic/tree/common.hpp
@@ -26,7 +26,6 @@
#include <boost/call_traits.hpp>
#include <boost/spirit/home/classic/namespace.hpp>
#include <boost/spirit/home/classic/core.hpp>
-#include <boost/detail/iterator.hpp> // for boost::detail::iterator_traits
#include <boost/assert.hpp>
#if defined(BOOST_SPIRIT_DEBUG) && \
@@ -37,6 +36,8 @@
#include <boost/spirit/home/classic/tree/common_fwd.hpp>
+#include <iterator> // for std::iterator_traits, std::distance
+
namespace boost { namespace spirit {
BOOST_SPIRIT_CLASSIC_NAMESPACE_BEGIN
@@ -242,7 +243,7 @@ template <typename IteratorT = char const*, typename ValueT = nil_t>
struct node_val_data
{
typedef
- typename boost::detail::iterator_traits<IteratorT>::value_type
+ typename std::iterator_traits<IteratorT>::value_type
value_type;
#if !defined(BOOST_SPIRIT_USE_BOOST_ALLOCATOR_FOR_TREES)
diff --git a/boost/spirit/home/classic/utility/regex.hpp b/boost/spirit/home/classic/utility/regex.hpp
index e8286d5812..14ace86d75 100644
--- a/boost/spirit/home/classic/utility/regex.hpp
+++ b/boost/spirit/home/classic/utility/regex.hpp
@@ -47,7 +47,7 @@
#include <boost/spirit/home/classic/meta/as_parser.hpp>
#include <boost/spirit/home/classic/core/parser.hpp>
#include <boost/spirit/home/classic/utility/impl/regex.ipp>
-#include <boost/detail/iterator.hpp> // for boost::detail::iterator_traits
+#include <iterator> // for std::iterator_traits
///////////////////////////////////////////////////////////////////////////////
namespace boost { namespace spirit {
@@ -75,7 +75,7 @@ struct rxstrlit : public parser<rxstrlit<CharT> > {
// forward iterators do not work here.
typedef typename ScannerT::iterator_t iterator_t;
typedef
- typename boost::detail::iterator_traits<iterator_t>::iterator_category
+ typename std::iterator_traits<iterator_t>::iterator_category
iterator_category;
BOOST_STATIC_ASSERT((
diff --git a/boost/spirit/home/classic/version.hpp b/boost/spirit/home/classic/version.hpp
index f95532c5a3..fa8ec231f2 100644
--- a/boost/spirit/home/classic/version.hpp
+++ b/boost/spirit/home/classic/version.hpp
@@ -10,21 +10,10 @@
///////////////////////////////////////////////////////////////////////////////
//
-// This checks, whether the used Boost library is at least V1.32.0
-//
-///////////////////////////////////////////////////////////////////////////////
-#include <boost/version.hpp>
-
-#if BOOST_VERSION < 103200
-#error "Spirit v1.8.x needs at least Boost V1.32.0 to compile successfully."
-#endif
-
-///////////////////////////////////////////////////////////////////////////////
-//
// This is the version of the current Spirit distribution
//
///////////////////////////////////////////////////////////////////////////////
-#define SPIRIT_VERSION 0x1810
+#define SPIRIT_VERSION 0x1811
#define SPIRIT_PIZZA_VERSION SPIRIT_MEGA_VEGGI // :-)
#endif // defined(SPIRIT_VERSION_HPP)
diff --git a/boost/spirit/home/karma/action/action.hpp b/boost/spirit/home/karma/action/action.hpp
index 23d621a138..a20ee1cedb 100644
--- a/boost/spirit/home/karma/action/action.hpp
+++ b/boost/spirit/home/karma/action/action.hpp
@@ -53,16 +53,14 @@ namespace boost { namespace spirit { namespace karma
, Attribute const& attr_) const
{
typedef typename attribute<Context, unused_type>::type attr_type;
- typedef traits::make_attribute<attr_type, Attribute> make_attribute;
// create a attribute if none is supplied
// this creates a _copy_ of the attribute because the semantic
// action will likely change parts of this
typedef traits::transform_attribute<
- typename make_attribute::type, attr_type, domain> transform;
+ Attribute const, attr_type, domain> transform;
- typename transform::type attr =
- traits::pre_transform<domain, attr_type>(make_attribute::call(attr_));
+ attr_type attr = transform::pre(attr_);
// call the function, passing the attribute, the context and a bool
// flag that the client can set to false to fail generating.
diff --git a/boost/spirit/home/karma/binary/binary.hpp b/boost/spirit/home/karma/binary/binary.hpp
index 4f88617dbe..2230264280 100644
--- a/boost/spirit/home/karma/binary/binary.hpp
+++ b/boost/spirit/home/karma/binary/binary.hpp
@@ -194,11 +194,11 @@ namespace boost { namespace spirit { namespace karma
};
///////////////////////////////////////////////////////////////////////
- template <BOOST_SCOPED_ENUM(boost::endian::endianness) bits>
+ template <BOOST_SCOPED_ENUM(boost::spirit::endian::endianness) bits>
struct what;
template <>
- struct what<boost::endian::endianness::native>
+ struct what<boost::spirit::endian::endianness::native>
{
static info is()
{
@@ -207,7 +207,7 @@ namespace boost { namespace spirit { namespace karma
};
template <>
- struct what<boost::endian::endianness::little>
+ struct what<boost::spirit::endian::endianness::little>
{
static info is()
{
@@ -216,7 +216,7 @@ namespace boost { namespace spirit { namespace karma
};
template <>
- struct what<boost::endian::endianness::big>
+ struct what<boost::spirit::endian::endianness::big>
{
static info is()
{
@@ -226,7 +226,7 @@ namespace boost { namespace spirit { namespace karma
}
///////////////////////////////////////////////////////////////////////////
- template <typename T, BOOST_SCOPED_ENUM(boost::endian::endianness) endian, int bits>
+ template <typename T, BOOST_SCOPED_ENUM(boost::spirit::endian::endianness) endian, int bits>
struct any_binary_generator
: primitive_generator<any_binary_generator<T, endian, bits> >
{
@@ -245,7 +245,7 @@ namespace boost { namespace spirit { namespace karma
// 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::endian::endian<endian, typename T::type, bits> p;
+ boost::spirit::endian::endian<endian, typename T::type, bits> p;
#if defined(BOOST_MSVC)
// warning C4244: 'argument' : conversion from 'const int' to 'foo', possible loss of data
@@ -293,7 +293,7 @@ namespace boost { namespace spirit { namespace karma
};
///////////////////////////////////////////////////////////////////////////
- template <typename T, BOOST_SCOPED_ENUM(boost::endian::endianness) endian, int bits>
+ template <typename T, BOOST_SCOPED_ENUM(boost::spirit::endian::endianness) endian, int bits>
struct literal_binary_generator
: primitive_generator<literal_binary_generator<T, endian, bits> >
{
@@ -344,7 +344,7 @@ namespace boost { namespace spirit { namespace karma
return karma::detail::what<endian>::is();
}
- typedef boost::endian::endian<endian, typename T::type,
+ typedef boost::spirit::endian::endian<endian, typename T::type,
bits> data_type;
data_type data_;
@@ -355,7 +355,7 @@ namespace boost { namespace spirit { namespace karma
///////////////////////////////////////////////////////////////////////////
namespace detail
{
- template <typename T, BOOST_SCOPED_ENUM(boost::endian::endianness) endian
+ template <typename T, BOOST_SCOPED_ENUM(boost::spirit::endian::endianness) endian
, int bits>
struct basic_binary
{
@@ -368,7 +368,7 @@ namespace boost { namespace spirit { namespace karma
};
template <typename Modifiers, typename T
- , BOOST_SCOPED_ENUM(boost::endian::endianness) endian, int bits>
+ , BOOST_SCOPED_ENUM(boost::spirit::endian::endianness) endian, int bits>
struct basic_binary_literal
{
typedef literal_binary_generator<T, endian, bits> result_type;
@@ -385,13 +385,13 @@ namespace boost { namespace spirit { namespace karma
template <typename Modifiers> \
struct make_primitive<tag::name, Modifiers> \
: detail::basic_binary<detail::integer<bits>, \
- boost::endian::endianness::endiantype, bits> {}; \
+ boost::spirit::endian::endianness::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::endian::endianness::endiantype, bits> {}; \
+ , boost::spirit::endian::endianness::endiantype, bits> {}; \
\
/***/
@@ -414,13 +414,13 @@ namespace boost { namespace spirit { namespace karma
template <typename Modifiers> \
struct make_primitive<tag::name, Modifiers> \
: detail::basic_binary<detail::floating_point<bits>, \
- boost::endian::endianness::endiantype, bits> {}; \
+ boost::spirit::endian::endianness::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::endian::endianness::endiantype, bits> {}; \
+ , boost::spirit::endian::endianness::endiantype, bits> {}; \
\
/***/
diff --git a/boost/spirit/home/karma/detail/attributes.hpp b/boost/spirit/home/karma/detail/attributes.hpp
index a313e319ef..ccb98bc8ec 100644
--- a/boost/spirit/home/karma/detail/attributes.hpp
+++ b/boost/spirit/home/karma/detail/attributes.hpp
@@ -44,22 +44,6 @@ namespace boost { namespace spirit { namespace karma
// Karma only, no post() and no fail() required
};
- // reference types need special handling
- template <typename Exposed, typename Transformed>
- struct transform_attribute<Exposed&, Transformed>
- : transform_attribute<Exposed, Transformed>
- {};
-
- template <typename Exposed, typename Transformed>
- struct transform_attribute<Exposed const&, Transformed>
- : transform_attribute<Exposed const, Transformed>
- {};
-
- template <typename Attribute>
- struct transform_attribute<Attribute const&, Attribute>
- : transform_attribute<Attribute const, Attribute>
- {};
-
// unused_type needs some special handling as well
template <>
struct transform_attribute<unused_type, unused_type>
@@ -74,16 +58,6 @@ namespace boost { namespace spirit { namespace karma
{};
template <typename Attribute>
- struct transform_attribute<unused_type, Attribute>
- : transform_attribute<unused_type, unused_type>
- {};
-
- template <typename Attribute>
- struct transform_attribute<unused_type const, Attribute>
- : transform_attribute<unused_type, unused_type>
- {};
-
- template <typename Attribute>
struct transform_attribute<Attribute, unused_type>
: transform_attribute<unused_type, unused_type>
{};
diff --git a/boost/spirit/home/karma/detail/indirect_iterator.hpp b/boost/spirit/home/karma/detail/indirect_iterator.hpp
index a9f3cc80c1..83721dfa0a 100644
--- a/boost/spirit/home/karma/detail/indirect_iterator.hpp
+++ b/boost/spirit/home/karma/detail/indirect_iterator.hpp
@@ -12,6 +12,7 @@
#include <boost/spirit/home/support/unused.hpp>
#include <boost/iterator/iterator_facade.hpp>
+#include <iterator> // for std::iterator_traits
///////////////////////////////////////////////////////////////////////////////
namespace boost { namespace spirit { namespace karma { namespace detail
@@ -23,13 +24,13 @@ namespace boost { namespace spirit { namespace karma { namespace detail
class indirect_iterator
: public boost::iterator_facade<
indirect_iterator<Iterator>
- , typename boost::detail::iterator_traits<Iterator>::value_type
+ , typename std::iterator_traits<Iterator>::value_type
, boost::forward_traversal_tag
- , typename boost::detail::iterator_traits<Iterator>::reference>
+ , typename std::iterator_traits<Iterator>::reference>
{
- typedef typename boost::detail::iterator_traits<Iterator>::value_type
+ typedef typename std::iterator_traits<Iterator>::value_type
base_value_type;
- typedef typename boost::detail::iterator_traits<Iterator>::reference
+ typedef typename std::iterator_traits<Iterator>::reference
base_reference_type;
typedef boost::iterator_facade<
diff --git a/boost/spirit/home/karma/directive/center_alignment.hpp b/boost/spirit/home/karma/directive/center_alignment.hpp
index 75e64d13c0..6b8a209e06 100644
--- a/boost/spirit/home/karma/directive/center_alignment.hpp
+++ b/boost/spirit/home/karma/directive/center_alignment.hpp
@@ -26,7 +26,6 @@
#include <boost/spirit/home/support/unused.hpp>
#include <boost/fusion/include/at.hpp>
#include <boost/fusion/include/vector.hpp>
-#include <boost/lexical_cast.hpp>
#include <boost/integer_traits.hpp>
#include <boost/mpl/bool.hpp>
#include <boost/utility/enable_if.hpp>
diff --git a/boost/spirit/home/karma/directive/left_alignment.hpp b/boost/spirit/home/karma/directive/left_alignment.hpp
index 949255f1ce..c41e801f5c 100644
--- a/boost/spirit/home/karma/directive/left_alignment.hpp
+++ b/boost/spirit/home/karma/directive/left_alignment.hpp
@@ -26,7 +26,6 @@
#include <boost/spirit/home/support/handles_container.hpp>
#include <boost/fusion/include/at.hpp>
#include <boost/fusion/include/vector.hpp>
-#include <boost/lexical_cast.hpp>
#include <boost/integer_traits.hpp>
#include <boost/mpl/bool.hpp>
#include <boost/utility/enable_if.hpp>
diff --git a/boost/spirit/home/karma/directive/maxwidth.hpp b/boost/spirit/home/karma/directive/maxwidth.hpp
index e1a271f30f..fae3965c68 100644
--- a/boost/spirit/home/karma/directive/maxwidth.hpp
+++ b/boost/spirit/home/karma/directive/maxwidth.hpp
@@ -26,7 +26,6 @@
#include <boost/spirit/home/support/unused.hpp>
#include <boost/fusion/include/at.hpp>
#include <boost/fusion/include/vector.hpp>
-#include <boost/lexical_cast.hpp>
#include <boost/detail/workaround.hpp>
///////////////////////////////////////////////////////////////////////////////
diff --git a/boost/spirit/home/karma/directive/right_alignment.hpp b/boost/spirit/home/karma/directive/right_alignment.hpp
index 50563f92f5..19dec37725 100644
--- a/boost/spirit/home/karma/directive/right_alignment.hpp
+++ b/boost/spirit/home/karma/directive/right_alignment.hpp
@@ -26,7 +26,6 @@
#include <boost/spirit/home/support/unused.hpp>
#include <boost/fusion/include/at.hpp>
#include <boost/fusion/include/vector.hpp>
-#include <boost/lexical_cast.hpp>
#include <boost/integer_traits.hpp>
#include <boost/mpl/bool.hpp>
#include <boost/utility/enable_if.hpp>
diff --git a/boost/spirit/home/karma/nonterminal/rule.hpp b/boost/spirit/home/karma/nonterminal/rule.hpp
index ab7db1265d..4a8604a656 100644
--- a/boost/spirit/home/karma/nonterminal/rule.hpp
+++ b/boost/spirit/home/karma/nonterminal/rule.hpp
@@ -286,15 +286,11 @@ namespace boost { namespace spirit { namespace karma
if (f)
{
// Create an attribute if none is supplied.
- typedef traits::make_attribute<attr_type, Attribute>
- make_attribute;
typedef traits::transform_attribute<
- typename make_attribute::type, attr_type, domain>
+ Attribute const, attr_type, domain>
transform;
- typename transform::type attr_ =
- traits::pre_transform<domain, attr_type>(
- make_attribute::call(attr));
+ typename transform::type attr_ = transform::pre(attr);
// If you are seeing a compilation error here, you are probably
// trying to use a rule or a grammar which has inherited
@@ -326,15 +322,11 @@ namespace boost { namespace spirit { namespace karma
if (f)
{
// Create an attribute if none is supplied.
- typedef traits::make_attribute<attr_type, Attribute>
- make_attribute;
typedef traits::transform_attribute<
- typename make_attribute::type, attr_type, domain>
+ Attribute const, attr_type, domain>
transform;
- typename transform::type attr_ =
- traits::pre_transform<domain, attr_type>(
- make_attribute::call(attr));
+ typename transform::type attr_ = transform::pre(attr);
// If you are seeing a compilation error here, you are probably
// trying to use a rule or a grammar which has inherited
diff --git a/boost/spirit/home/lex/lexer/lexer.hpp b/boost/spirit/home/lex/lexer/lexer.hpp
index e733533a41..f57e07d4fd 100644
--- a/boost/spirit/home/lex/lexer/lexer.hpp
+++ b/boost/spirit/home/lex/lexer/lexer.hpp
@@ -20,10 +20,10 @@
#include <boost/spirit/home/lex/lexer/token_def.hpp>
#include <boost/assert.hpp>
#include <boost/noncopyable.hpp>
-#include <boost/detail/iterator.hpp>
#include <boost/fusion/include/vector.hpp>
#include <boost/mpl/assert.hpp>
#include <boost/range/iterator_range.hpp>
+#include <iterator> // for std::iterator_traits
#include <string>
namespace boost { namespace spirit { namespace lex
@@ -83,7 +83,7 @@ namespace boost { namespace spirit { namespace lex
if (first != last) {
typedef typename
- boost::detail::iterator_traits<Iterator>::value_type
+ std::iterator_traits<Iterator>::value_type
token_type;
token_type const& t = *first;
@@ -376,8 +376,16 @@ namespace boost { namespace spirit { namespace lex
typedef detail::lexer_def_<lexer> lexer_def;
typedef std::basic_string<char_type> string_type;
- lexer(unsigned int flags = match_flags::match_default
- , id_type first_id = id_type(min_token_id))
+ // if `id_type` was specified but `first_id` is not provided
+ // the `min_token_id` value may be out of range for `id_type`,
+ // but it will be a problem only if unique ids feature is in use.
+ lexer(unsigned int flags = match_flags::match_default)
+ : lexer_type(flags)
+ , next_token_id(min_token_id)
+ , self(this_(), lexer_type::initial_state())
+ {}
+
+ lexer(unsigned int flags, id_type first_id)
: lexer_type(flags)
, next_token_id(first_id)
, self(this_(), lexer_type::initial_state())
diff --git a/boost/spirit/home/lex/lexer/lexertl/functor.hpp b/boost/spirit/home/lex/lexer/lexertl/functor.hpp
index d7b22413a8..273e269d6e 100644
--- a/boost/spirit/home/lex/lexer/lexertl/functor.hpp
+++ b/boost/spirit/home/lex/lexer/lexertl/functor.hpp
@@ -11,10 +11,10 @@
#endif
#include <boost/mpl/bool.hpp>
-#include <boost/detail/iterator.hpp>
#include <boost/detail/workaround.hpp>
#include <boost/spirit/home/lex/lexer/pass_flags.hpp>
#include <boost/assert.hpp>
+#include <iterator> // for std::iterator_traits
#if 0 != __COMO_VERSION__ || !BOOST_WORKAROUND(BOOST_MSVC, <= 1310)
#define BOOST_SPIRIT_STATIC_EOF 1
@@ -66,7 +66,7 @@ namespace boost { namespace spirit { namespace lex { namespace lexertl
{
public:
typedef typename
- boost::detail::iterator_traits<Iterator>::value_type
+ std::iterator_traits<Iterator>::value_type
char_type;
private:
diff --git a/boost/spirit/home/lex/lexer/lexertl/functor_data.hpp b/boost/spirit/home/lex/lexer/lexertl/functor_data.hpp
index 6b36cc6942..e348100359 100644
--- a/boost/spirit/home/lex/lexer/lexertl/functor_data.hpp
+++ b/boost/spirit/home/lex/lexer/lexertl/functor_data.hpp
@@ -19,6 +19,7 @@
#include <boost/spirit/home/lex/lexer/lexertl/wrap_action.hpp>
#include <boost/mpl/bool.hpp>
#include <boost/optional.hpp>
+#include <iterator> // for std::iterator_traits
namespace boost { namespace spirit { namespace lex { namespace lexertl
{
@@ -36,7 +37,7 @@ namespace boost { namespace spirit { namespace lex { namespace lexertl
{
protected:
typedef typename
- boost::detail::iterator_traits<Iterator>::value_type
+ std::iterator_traits<Iterator>::value_type
char_type;
public:
diff --git a/boost/spirit/home/lex/lexer/lexertl/generate_static.hpp b/boost/spirit/home/lex/lexer/lexertl/generate_static.hpp
index 6a07ffde0a..b2e7561b11 100644
--- a/boost/spirit/home/lex/lexer/lexertl/generate_static.hpp
+++ b/boost/spirit/home/lex/lexer/lexertl/generate_static.hpp
@@ -19,7 +19,6 @@
#include <boost/spirit/home/support/detail/lexer/debug.hpp>
#include <boost/spirit/home/lex/lexer/lexertl/static_version.hpp>
#include <boost/algorithm/string.hpp>
-#include <boost/lexical_cast.hpp>
#include <boost/scoped_array.hpp>
///////////////////////////////////////////////////////////////////////////////
@@ -156,9 +155,7 @@ namespace boost { namespace spirit { namespace lex { namespace lexertl
os_ << "struct lexer" << suffix << "\n{\n";
os_ << " // version number and feature-set of compatible static lexer engine\n";
os_ << " enum\n";
- os_ << " {\n static_version = "
- << boost::lexical_cast<std::basic_string<Char> >(SPIRIT_STATIC_LEXER_VERSION)
- << ",\n";
+ os_ << " {\n static_version = " << SPIRIT_STATIC_LEXER_VERSION << ",\n";
os_ << " supports_bol = " << std::boolalpha << bol << ",\n";
os_ << " supports_eol = " << std::boolalpha << eol << "\n";
os_ << " };\n\n";
@@ -911,7 +908,6 @@ namespace boost { namespace spirit { namespace lex { namespace lexertl
os_ << "#if !defined(BOOST_SPIRIT_LEXER_NEXT_TOKEN_" << guard << ")\n";
os_ << "#define BOOST_SPIRIT_LEXER_NEXT_TOKEN_" << guard << "\n\n";
- os_ << "#include <boost/detail/iterator.hpp>\n";
os_ << "#include <boost/spirit/home/support/detail/lexer/char_traits.hpp>\n\n";
generate_delimiter(os_);
diff --git a/boost/spirit/home/lex/lexer/lexertl/iterator_tokenizer.hpp b/boost/spirit/home/lex/lexer/lexertl/iterator_tokenizer.hpp
index 31dffcedde..850c55d6dd 100644
--- a/boost/spirit/home/lex/lexer/lexertl/iterator_tokenizer.hpp
+++ b/boost/spirit/home/lex/lexer/lexertl/iterator_tokenizer.hpp
@@ -10,11 +10,11 @@
#pragma once
#endif
-#include <boost/detail/iterator.hpp>
#include <boost/spirit/home/support/detail/lexer/state_machine.hpp>
#include <boost/spirit/home/support/detail/lexer/consts.hpp>
#include <boost/spirit/home/support/detail/lexer/size_t.hpp>
#include <boost/spirit/home/support/detail/lexer/char_traits.hpp>
+#include <iterator> // for std::iterator_traits
#include <vector>
namespace boost { namespace spirit { namespace lex { namespace lexertl
@@ -25,8 +25,7 @@ namespace boost { namespace spirit { namespace lex { namespace lexertl
{
public:
typedef std::vector<std::size_t> size_t_vector;
- typedef typename boost::detail::iterator_traits<Iterator>::value_type
- char_type;
+ typedef typename std::iterator_traits<Iterator>::value_type char_type;
static std::size_t next (
boost::lexer::basic_state_machine<char_type> const& state_machine_
@@ -74,7 +73,7 @@ namespace boost { namespace spirit { namespace lex { namespace lexertl
else
{
typedef typename
- boost::detail::iterator_traits<Iterator>::value_type
+ std::iterator_traits<Iterator>::value_type
value_type;
typedef typename
boost::lexer::char_traits<value_type>::index_type
@@ -188,7 +187,7 @@ namespace boost { namespace spirit { namespace lex { namespace lexertl
else
{
typedef typename
- boost::detail::iterator_traits<Iterator>::value_type
+ std::iterator_traits<Iterator>::value_type
value_type;
typedef typename
boost::lexer::char_traits<value_type>::index_type
diff --git a/boost/spirit/home/lex/lexer/lexertl/lexer.hpp b/boost/spirit/home/lex/lexer/lexertl/lexer.hpp
index 0f8af55d0d..ea9fab4fbf 100644
--- a/boost/spirit/home/lex/lexer/lexertl/lexer.hpp
+++ b/boost/spirit/home/lex/lexer/lexertl/lexer.hpp
@@ -27,6 +27,8 @@
#include <boost/foreach.hpp>
+#include <iterator> // for std::iterator_traits
+
namespace boost { namespace spirit { namespace lex { namespace lexertl
{
///////////////////////////////////////////////////////////////////////////
@@ -158,8 +160,7 @@ namespace boost { namespace spirit { namespace lex { namespace lexertl
operator safe_bool() const
{ return initialized_dfa_ ? &dummy::true_ : 0; }
- typedef typename boost::detail::iterator_traits<Iterator>::value_type
- char_type;
+ typedef typename std::iterator_traits<Iterator>::value_type char_type;
typedef std::basic_string<char_type> string_type;
typedef boost::lexer::basic_rules<char_type> basic_rules_type;
diff --git a/boost/spirit/home/lex/lexer/lexertl/position_token.hpp b/boost/spirit/home/lex/lexer/lexertl/position_token.hpp
index 7bf13db12f..e1187708b4 100644
--- a/boost/spirit/home/lex/lexer/lexertl/position_token.hpp
+++ b/boost/spirit/home/lex/lexer/lexertl/position_token.hpp
@@ -23,7 +23,6 @@
#include <boost/fusion/include/vector.hpp>
#include <boost/fusion/include/at.hpp>
#include <boost/fusion/include/value_at.hpp>
-#include <boost/detail/iterator.hpp>
#include <boost/variant.hpp>
#include <boost/mpl/vector.hpp>
#include <boost/mpl/bool.hpp>
diff --git a/boost/spirit/home/lex/lexer/lexertl/static_functor_data.hpp b/boost/spirit/home/lex/lexer/lexertl/static_functor_data.hpp
index 725f5c8edc..109be2a7f8 100644
--- a/boost/spirit/home/lex/lexer/lexertl/static_functor_data.hpp
+++ b/boost/spirit/home/lex/lexer/lexertl/static_functor_data.hpp
@@ -18,6 +18,7 @@
#include <boost/spirit/home/lex/lexer/lexertl/wrap_action.hpp>
#include <boost/mpl/bool.hpp>
#include <boost/algorithm/string/predicate.hpp>
+#include <iterator> // for std::iterator_traits
namespace boost { namespace spirit { namespace lex { namespace lexertl
{
@@ -48,7 +49,7 @@ namespace boost { namespace spirit { namespace lex { namespace lexertl
{
protected:
typedef typename
- boost::detail::iterator_traits<Iterator>::value_type
+ std::iterator_traits<Iterator>::value_type
char_type;
public:
diff --git a/boost/spirit/home/lex/lexer/lexertl/static_lexer.hpp b/boost/spirit/home/lex/lexer/lexertl/static_lexer.hpp
index d6deffc886..e41526bab7 100644
--- a/boost/spirit/home/lex/lexer/lexertl/static_lexer.hpp
+++ b/boost/spirit/home/lex/lexer/lexertl/static_lexer.hpp
@@ -18,6 +18,7 @@
#if defined(BOOST_SPIRIT_DEBUG)
#include <boost/spirit/home/support/detail/lexer/debug.hpp>
#endif
+#include <iterator> // for std::iterator_traits
namespace boost { namespace spirit { namespace lex { namespace lexertl
{
@@ -119,8 +120,7 @@ namespace boost { namespace spirit { namespace lex { namespace lexertl
// object is always valid
operator safe_bool() const { return &dummy::true_; }
- typedef typename boost::detail::iterator_traits<Iterator>::value_type
- char_type;
+ typedef typename std::iterator_traits<Iterator>::value_type char_type;
typedef std::basic_string<char_type> string_type;
// Every lexer type to be used as a lexer for Spirit has to conform to
diff --git a/boost/spirit/home/lex/lexer/lexertl/token.hpp b/boost/spirit/home/lex/lexer/lexertl/token.hpp
index f795bcacac..daa067a0a8 100644
--- a/boost/spirit/home/lex/lexer/lexertl/token.hpp
+++ b/boost/spirit/home/lex/lexer/lexertl/token.hpp
@@ -23,7 +23,6 @@
#include <boost/fusion/include/vector.hpp>
#include <boost/fusion/include/at.hpp>
#include <boost/fusion/include/value_at.hpp>
-#include <boost/detail/iterator.hpp>
#include <boost/variant.hpp>
#include <boost/mpl/bool.hpp>
#include <boost/mpl/vector.hpp>
diff --git a/boost/spirit/home/lex/lexer/token_def.hpp b/boost/spirit/home/lex/lexer/token_def.hpp
index 1bd2534505..a869bf9112 100644
--- a/boost/spirit/home/lex/lexer/token_def.hpp
+++ b/boost/spirit/home/lex/lexer/token_def.hpp
@@ -24,10 +24,10 @@
#include <boost/fusion/include/vector.hpp>
#include <boost/mpl/if.hpp>
-#include <boost/detail/iterator.hpp>
#include <boost/type_traits/is_same.hpp>
#include <boost/variant.hpp>
+#include <iterator> // for std::iterator_traits
#include <string>
#include <cstdlib>
@@ -92,7 +92,7 @@ namespace boost { namespace spirit { namespace lex
if (first != last) {
typedef typename
- boost::detail::iterator_traits<Iterator>::value_type
+ std::iterator_traits<Iterator>::value_type
token_type;
// If the following assertion fires you probably forgot to
diff --git a/boost/spirit/home/lex/qi/plain_raw_token.hpp b/boost/spirit/home/lex/qi/plain_raw_token.hpp
index ebe980de86..d57db054e8 100644
--- a/boost/spirit/home/lex/qi/plain_raw_token.hpp
+++ b/boost/spirit/home/lex/qi/plain_raw_token.hpp
@@ -26,6 +26,7 @@
#include <boost/type_traits/is_integral.hpp>
#include <boost/type_traits/is_enum.hpp>
#include <boost/lexical_cast.hpp>
+#include <iterator> // for std::iterator_traits
namespace boost { namespace spirit
{
@@ -85,7 +86,7 @@ namespace boost { namespace spirit { namespace qi
// been initialized with
typedef typename
- boost::detail::iterator_traits<Iterator>::value_type
+ std::iterator_traits<Iterator>::value_type
token_type;
typedef typename token_type::id_type id_type;
diff --git a/boost/spirit/home/lex/qi/plain_token.hpp b/boost/spirit/home/lex/qi/plain_token.hpp
index 11961e3464..ebb4c18990 100644
--- a/boost/spirit/home/lex/qi/plain_token.hpp
+++ b/boost/spirit/home/lex/qi/plain_token.hpp
@@ -27,6 +27,7 @@
#include <boost/type_traits/is_integral.hpp>
#include <boost/type_traits/is_enum.hpp>
#include <boost/lexical_cast.hpp>
+#include <iterator> // for std::iterator_traits
namespace boost { namespace spirit
{
@@ -102,7 +103,7 @@ namespace boost { namespace spirit { namespace qi
// been initialized with
typedef typename
- boost::detail::iterator_traits<Iterator>::value_type
+ std::iterator_traits<Iterator>::value_type
token_type;
typedef typename token_type::id_type id_type;
@@ -154,7 +155,7 @@ namespace boost { namespace spirit { namespace qi
// been initialized with
typedef typename
- boost::detail::iterator_traits<Iterator>::value_type
+ std::iterator_traits<Iterator>::value_type
token_type;
typedef typename token_type::id_type id_type;
diff --git a/boost/spirit/home/lex/qi/plain_tokenid.hpp b/boost/spirit/home/lex/qi/plain_tokenid.hpp
index 7a70c77581..db14873a11 100644
--- a/boost/spirit/home/lex/qi/plain_tokenid.hpp
+++ b/boost/spirit/home/lex/qi/plain_tokenid.hpp
@@ -27,6 +27,7 @@
#include <boost/type_traits/is_integral.hpp>
#include <boost/type_traits/is_enum.hpp>
#include <boost/lexical_cast.hpp>
+#include <iterator> // for std::iterator_traits
namespace boost { namespace spirit
{
@@ -104,7 +105,7 @@ namespace boost { namespace spirit { namespace qi
// been initialized with
typedef typename
- boost::detail::iterator_traits<Iterator>::value_type
+ std::iterator_traits<Iterator>::value_type
token_type;
typedef typename token_type::id_type id_type;
@@ -155,7 +156,7 @@ namespace boost { namespace spirit { namespace qi
// been initialized with
typedef typename
- boost::detail::iterator_traits<Iterator>::value_type
+ std::iterator_traits<Iterator>::value_type
token_type;
typedef typename token_type::id_type id_type;
diff --git a/boost/spirit/home/lex/qi/plain_tokenid_mask.hpp b/boost/spirit/home/lex/qi/plain_tokenid_mask.hpp
index 92ac1268cc..3e9139a933 100644
--- a/boost/spirit/home/lex/qi/plain_tokenid_mask.hpp
+++ b/boost/spirit/home/lex/qi/plain_tokenid_mask.hpp
@@ -26,6 +26,7 @@
#include <boost/type_traits/is_integral.hpp>
#include <boost/type_traits/is_enum.hpp>
#include <boost/lexical_cast.hpp>
+#include <iterator> // for std::iterator_traits
namespace boost { namespace spirit
{
@@ -84,7 +85,7 @@ namespace boost { namespace spirit { namespace qi
// been initialized with
typedef typename
- boost::detail::iterator_traits<Iterator>::value_type
+ std::iterator_traits<Iterator>::value_type
token_type;
typedef typename token_type::id_type id_type;
diff --git a/boost/spirit/home/qi/action/action.hpp b/boost/spirit/home/qi/action/action.hpp
index 2bdf7d8f87..286adb267f 100644
--- a/boost/spirit/home/qi/action/action.hpp
+++ b/boost/spirit/home/qi/action/action.hpp
@@ -52,14 +52,12 @@ namespace boost { namespace spirit { namespace qi
, Attribute& attr_) const
{
typedef typename attribute<Context, Iterator>::type attr_type;
- typedef traits::make_attribute<attr_type, Attribute> make_attribute;
// create an attribute if one is not supplied
typedef traits::transform_attribute<
- typename make_attribute::type, attr_type, domain> transform;
+ Attribute, attr_type, domain> transform;
- typename make_attribute::type made_attr = make_attribute::call(attr_);
- typename transform::type attr = transform::pre(made_attr);
+ typename transform::type attr = transform::pre(attr_);
Iterator save = first;
if (subject.parse(first, last, context, skipper, attr))
@@ -70,7 +68,7 @@ namespace boost { namespace spirit { namespace qi
{
// Do up-stream transformation, this integrates the results
// back into the original attribute value, if appropriate.
- traits::post_transform(attr_, attr);
+ transform::post(attr_, attr);
return true;
}
@@ -109,14 +107,9 @@ namespace boost { namespace spirit { namespace qi
, unused_type) const
{
typedef typename attribute<Context, Iterator>::type attr_type;
- typedef traits::make_attribute<attr_type, unused_type> make_attribute;
// synthesize the attribute since one is not supplied
- typedef traits::transform_attribute<
- typename make_attribute::type, attr_type, domain> transform;
-
- typename make_attribute::type made_attr = make_attribute::call(unused_type());
- typename transform::type attr = transform::pre(made_attr);
+ attr_type attr = attr_type();
Iterator save = first;
if (subject.parse(first, last, context, skipper, attr))
diff --git a/boost/spirit/home/qi/auxiliary/attr_cast.hpp b/boost/spirit/home/qi/auxiliary/attr_cast.hpp
index 93d646c58d..746679d371 100644
--- a/boost/spirit/home/qi/auxiliary/attr_cast.hpp
+++ b/boost/spirit/home/qi/auxiliary/attr_cast.hpp
@@ -101,7 +101,7 @@ namespace boost { namespace spirit { namespace qi
// do up-stream transformation, this mainly integrates the results
// back into the original attribute value, if appropriate
- traits::post_transform(attr_param, attr_);
+ transform::post(attr_param, attr_);
return true;
}
diff --git a/boost/spirit/home/qi/binary/binary.hpp b/boost/spirit/home/qi/binary/binary.hpp
index a4e83f0ba5..441d1ac21d 100644
--- a/boost/spirit/home/qi/binary/binary.hpp
+++ b/boost/spirit/home/qi/binary/binary.hpp
@@ -195,11 +195,11 @@ namespace boost { namespace spirit { namespace qi
};
///////////////////////////////////////////////////////////////////////
- template <BOOST_SCOPED_ENUM(boost::endian::endianness) bits>
+ template <BOOST_SCOPED_ENUM(boost::spirit::endian::endianness) bits>
struct what;
template <>
- struct what<boost::endian::endianness::native>
+ struct what<boost::spirit::endian::endianness::native>
{
static std::string is()
{
@@ -208,7 +208,7 @@ namespace boost { namespace spirit { namespace qi
};
template <>
- struct what<boost::endian::endianness::little>
+ struct what<boost::spirit::endian::endianness::little>
{
static char const* is()
{
@@ -217,7 +217,7 @@ namespace boost { namespace spirit { namespace qi
};
template <>
- struct what<boost::endian::endianness::big>
+ struct what<boost::spirit::endian::endianness::big>
{
static char const* is()
{
@@ -227,13 +227,13 @@ namespace boost { namespace spirit { namespace qi
}
///////////////////////////////////////////////////////////////////////////
- template <typename T, BOOST_SCOPED_ENUM(boost::endian::endianness) endian, int bits>
+ template <typename T, BOOST_SCOPED_ENUM(boost::spirit::endian::endianness) endian, int bits>
struct any_binary_parser : primitive_parser<any_binary_parser<T, endian, bits> >
{
template <typename Context, typename Iterator>
struct attribute
{
- typedef boost::endian::endian<endian, typename T::type,
+ typedef boost::spirit::endian::endian<endian, typename T::type,
bits> type;
};
@@ -270,7 +270,7 @@ namespace boost { namespace spirit { namespace qi
///////////////////////////////////////////////////////////////////////////
template <typename V, typename T
- , BOOST_SCOPED_ENUM(boost::endian::endianness) endian, int bits>
+ , BOOST_SCOPED_ENUM(boost::spirit::endian::endianness) endian, int bits>
struct binary_lit_parser
: primitive_parser<binary_lit_parser<V, T, endian, bits> >
{
@@ -295,7 +295,7 @@ namespace boost { namespace spirit { namespace qi
// 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.
- boost::endian::endian<endian, typename T::type, bits> attr_;
+ boost::spirit::endian::endian<endian, typename T::type, bits> attr_;
#if defined(BOOST_MSVC)
// warning C4244: 'argument' : conversion from 'const int' to 'foo', possible loss of data
@@ -333,7 +333,7 @@ namespace boost { namespace spirit { namespace qi
///////////////////////////////////////////////////////////////////////////
// Parser generators: make_xxx function (objects)
///////////////////////////////////////////////////////////////////////////
- template <typename T, BOOST_SCOPED_ENUM(boost::endian::endianness) endian, int bits>
+ template <typename T, BOOST_SCOPED_ENUM(boost::spirit::endian::endianness) endian, int bits>
struct make_binary_parser
{
typedef any_binary_parser<T, endian, bits> result_type;
@@ -344,7 +344,7 @@ namespace boost { namespace spirit { namespace qi
};
template <typename V, typename T
- , BOOST_SCOPED_ENUM(boost::endian::endianness) endian, int bits>
+ , BOOST_SCOPED_ENUM(boost::spirit::endian::endianness) endian, int bits>
struct make_binary_lit_parser
{
typedef binary_lit_parser<V, T, endian, bits> result_type;
@@ -359,13 +359,13 @@ namespace boost { namespace spirit { namespace qi
template <typename Modifiers> \
struct make_primitive<tag::name, Modifiers> \
: make_binary_parser<detail::integer<bits>, \
- boost::endian::endianness::endiantype, bits> {}; \
+ boost::spirit::endian::endianness::endiantype, bits> {}; \
\
template <typename Modifiers, typename A0> \
struct make_primitive< \
terminal_ex<tag::name, fusion::vector1<A0> > , Modifiers> \
: make_binary_lit_parser<A0, detail::integer<bits>, \
- boost::endian::endianness::endiantype, bits> {}; \
+ boost::spirit::endian::endianness::endiantype, bits> {}; \
\
/***/
@@ -388,13 +388,13 @@ namespace boost { namespace spirit { namespace qi
template<typename Modifiers> \
struct make_primitive<tag::name, Modifiers> \
: make_binary_parser<detail::floating_point<bits>, \
- boost::endian::endianness::endiantype, bits> {}; \
+ boost::spirit::endian::endianness::endiantype, bits> {}; \
\
template<typename Modifiers, typename A0> \
struct make_primitive< \
terminal_ex<tag::name, fusion::vector1<A0> >, Modifiers> \
: make_binary_lit_parser<A0, detail::floating_point<bits>, \
- boost::endian::endianness::endiantype, \
+ boost::spirit::endian::endianness::endiantype, \
bits> {}; \
\
/***/
diff --git a/boost/spirit/home/qi/detail/alternative_function.hpp b/boost/spirit/home/qi/detail/alternative_function.hpp
index 9bd0f73c7b..aeb6314fb4 100644
--- a/boost/spirit/home/qi/detail/alternative_function.hpp
+++ b/boost/spirit/home/qi/detail/alternative_function.hpp
@@ -30,9 +30,7 @@ namespace boost { namespace spirit { namespace qi { namespace detail
typedef typename variant_type::types types;
typedef typename mpl::end<types>::type end;
- typedef typename
- mpl::find_if<types, is_same<mpl::_1, Expected> >::type
- iter_1;
+ typedef typename mpl::find<types, Expected>::type iter_1;
typedef typename
mpl::eval_if<
diff --git a/boost/spirit/home/qi/detail/attributes.hpp b/boost/spirit/home/qi/detail/attributes.hpp
index c5f5037d8c..5ec776ba4f 100644
--- a/boost/spirit/home/qi/detail/attributes.hpp
+++ b/boost/spirit/home/qi/detail/attributes.hpp
@@ -94,16 +94,6 @@ namespace boost { namespace spirit { namespace qi
}
};
- // reference types need special handling
- template <typename Attribute>
- struct transform_attribute<Attribute&, Attribute>
- {
- typedef Attribute& type;
- static Attribute& pre(Attribute& val) { return val; }
- static void post(Attribute&, Attribute const&) {}
- static void fail(Attribute&) {}
- };
-
// unused_type needs some special handling as well
template <>
struct transform_attribute<unused_type, unused_type>
@@ -120,16 +110,6 @@ namespace boost { namespace spirit { namespace qi
{};
template <typename Attribute>
- struct transform_attribute<unused_type, Attribute>
- : transform_attribute<unused_type, unused_type>
- {};
-
- template <typename Attribute>
- struct transform_attribute<unused_type const, Attribute>
- : transform_attribute<unused_type, unused_type>
- {};
-
- template <typename Attribute>
struct transform_attribute<Attribute, unused_type>
: transform_attribute<unused_type, unused_type>
{};
@@ -149,30 +129,6 @@ namespace boost { namespace spirit { namespace traits
: qi::transform_attribute<Exposed, Transformed>
{};
}
-
- template <typename Exposed, typename Transformed>
- struct transform_attribute<Exposed&, Transformed, qi::domain>
- : transform_attribute<Exposed, Transformed, qi::domain>
- {};
-
- template <typename Attribute>
- struct transform_attribute<Attribute&, Attribute, qi::domain>
- : qi::transform_attribute<Attribute&, Attribute>
- {};
-
- ///////////////////////////////////////////////////////////////////////////
- template <typename Exposed, typename Transformed>
- void post_transform(Exposed& dest, Transformed const& attr)
- {
- return transform_attribute<Exposed, Transformed, qi::domain>::post(dest, attr);
- }
-
- ///////////////////////////////////////////////////////////////////////////
- template <typename Exposed, typename Transformed>
- void fail_transform(Exposed& dest, Transformed const&)
- {
- return transform_attribute<Exposed, Transformed, qi::domain>::fail(dest);
- }
}}}
#endif
diff --git a/boost/spirit/home/qi/detail/expectation_failure.hpp b/boost/spirit/home/qi/detail/expectation_failure.hpp
index 21ba6895bf..26ab1fbe0f 100644
--- a/boost/spirit/home/qi/detail/expectation_failure.hpp
+++ b/boost/spirit/home/qi/detail/expectation_failure.hpp
@@ -24,7 +24,7 @@ namespace boost { namespace spirit { namespace qi {
: std::runtime_error("boost::spirit::qi::expectation_failure")
, first(first_), last(last_), what_(what)
{}
- ~expectation_failure() throw() {}
+ ~expectation_failure() BOOST_NOEXCEPT_OR_NOTHROW {}
Iterator first;
Iterator last;
diff --git a/boost/spirit/home/qi/nonterminal/rule.hpp b/boost/spirit/home/qi/nonterminal/rule.hpp
index 0901420312..65d7646346 100644
--- a/boost/spirit/home/qi/nonterminal/rule.hpp
+++ b/boost/spirit/home/qi/nonterminal/rule.hpp
@@ -12,10 +12,12 @@
#endif
#include <boost/assert.hpp>
+#include <boost/static_assert.hpp>
#include <boost/config.hpp>
#include <boost/function.hpp>
#include <boost/mpl/vector.hpp>
#include <boost/type_traits/add_reference.hpp>
+#include <boost/type_traits/is_convertible.hpp>
#include <boost/type_traits/is_same.hpp>
#include <boost/fusion/include/vector.hpp>
@@ -275,22 +277,27 @@ namespace boost { namespace spirit { namespace qi
, Context& /*context*/, Skipper const& skipper
, Attribute& attr_param) const
{
+ BOOST_STATIC_ASSERT_MSG((is_same<skipper_type, unused_type>::value ||
+ !is_same<Skipper, unused_type>::value),
+ "The rule was instantiated with a skipper type but you have not pass any. "
+ "Did you use `parse` instead of `phrase_parse`?");
+ BOOST_STATIC_ASSERT_MSG(
+ (is_convertible<Skipper const&, skipper_type>::value),
+ "The passed skipper is not compatible/convertible to one "
+ "that the rule was instantiated with");
if (f)
{
// do a preskip if this is an implied lexeme
if (is_same<skipper_type, unused_type>::value)
qi::skip_over(first, last, skipper);
- typedef traits::make_attribute<attr_type, Attribute> make_attribute;
-
// do down-stream transformation, provides attribute for
// rhs parser
typedef traits::transform_attribute<
- typename make_attribute::type, attr_type, domain>
+ Attribute, attr_type, domain>
transform;
- typename make_attribute::type made_attr = make_attribute::call(attr_param);
- typename transform::type attr_ = transform::pre(made_attr);
+ typename transform::type attr_ = transform::pre(attr_param);
// If you are seeing a compilation error here, you are probably
// trying to use a rule or a grammar which has inherited
@@ -305,12 +312,12 @@ namespace boost { namespace spirit { namespace qi
{
// do up-stream transformation, this integrates the results
// back into the original attribute value, if appropriate
- traits::post_transform(attr_param, attr_);
+ transform::post(attr_param, attr_);
return true;
}
// inform attribute transformation of failed rhs
- traits::fail_transform(attr_param, attr_);
+ transform::fail(attr_param);
}
return false;
}
@@ -321,22 +328,27 @@ namespace boost { namespace spirit { namespace qi
, Context& caller_context, Skipper const& skipper
, Attribute& attr_param, Params const& params) const
{
+ BOOST_STATIC_ASSERT_MSG((is_same<skipper_type, unused_type>::value ||
+ !is_same<Skipper, unused_type>::value),
+ "The rule was instantiated with a skipper type but you have not pass any. "
+ "Did you use `parse` instead of `phrase_parse`?");
+ BOOST_STATIC_ASSERT_MSG(
+ (is_convertible<Skipper const&, skipper_type>::value),
+ "The passed skipper is not compatible/convertible to one "
+ "that the rule was instantiated with");
if (f)
{
// do a preskip if this is an implied lexeme
if (is_same<skipper_type, unused_type>::value)
qi::skip_over(first, last, skipper);
- typedef traits::make_attribute<attr_type, Attribute> make_attribute;
-
// do down-stream transformation, provides attribute for
// rhs parser
typedef traits::transform_attribute<
- typename make_attribute::type, attr_type, domain>
+ Attribute, attr_type, domain>
transform;
- typename make_attribute::type made_attr = make_attribute::call(attr_param);
- typename transform::type attr_ = transform::pre(made_attr);
+ typename transform::type attr_ = transform::pre(attr_param);
// If you are seeing a compilation error here, you are probably
// trying to use a rule or a grammar which has inherited
@@ -351,12 +363,12 @@ namespace boost { namespace spirit { namespace qi
{
// do up-stream transformation, this integrates the results
// back into the original attribute value, if appropriate
- traits::post_transform(attr_param, attr_);
+ transform::post(attr_param, attr_);
return true;
}
// inform attribute transformation of failed rhs
- traits::fail_transform(attr_param, attr_);
+ transform::fail(attr_param);
}
return false;
}
diff --git a/boost/spirit/home/qi/numeric/detail/numeric_utils.hpp b/boost/spirit/home/qi/numeric/detail/numeric_utils.hpp
index f1154dc92a..f6bd889037 100644
--- a/boost/spirit/home/qi/numeric/detail/numeric_utils.hpp
+++ b/boost/spirit/home/qi/numeric/detail/numeric_utils.hpp
@@ -15,7 +15,6 @@
#pragma once
#endif
-#include <boost/detail/iterator.hpp>
#include <boost/spirit/home/support/unused.hpp>
#include <boost/spirit/home/qi/detail/attributes.hpp>
#include <boost/spirit/home/support/char_encoding/ascii.hpp>
@@ -31,7 +30,8 @@
#include <boost/mpl/bool.hpp>
#include <boost/mpl/and.hpp>
#include <boost/limits.hpp>
-#include <boost/integer_traits.hpp>
+#include <boost/static_assert.hpp>
+#include <iterator> // for std::iterator_traits
#if defined(BOOST_MSVC)
# pragma warning(push)
@@ -56,6 +56,9 @@ namespace boost { namespace spirit { namespace qi { namespace detail
template <typename T, unsigned Radix>
struct digits_traits;
+ template <int Digits, unsigned Radix>
+ struct digits2_to_n;
+
// lookup table for log2(x) : 2 <= x <= 36
#define BOOST_SPIRIT_LOG2 (#error)(#error) \
(1000000)(1584960)(2000000)(2321920)(2584960)(2807350) \
@@ -67,11 +70,10 @@ namespace boost { namespace spirit { namespace qi { namespace detail
/***/
#define BOOST_PP_LOCAL_MACRO(Radix) \
- template <typename T> struct digits_traits<T, Radix> \
+ template <int Digits> struct digits2_to_n<Digits, Radix> \
{ \
- typedef std::numeric_limits<T> numeric_limits_type; \
BOOST_STATIC_CONSTANT(int, value = static_cast<int>( \
- (numeric_limits_type::digits * 1000000) / \
+ (Digits * 1000000) / \
BOOST_PP_SEQ_ELEM(Radix, BOOST_SPIRIT_LOG2))); \
}; \
/***/
@@ -81,6 +83,18 @@ namespace boost { namespace spirit { namespace qi { namespace detail
#undef BOOST_SPIRIT_LOG2
+ template <typename T, unsigned Radix>
+ struct digits_traits : digits2_to_n<std::numeric_limits<T>::digits, Radix>
+ {
+ BOOST_STATIC_ASSERT(std::numeric_limits<T>::radix == 2);
+ };
+
+ template <typename T>
+ struct digits_traits<T, 10>
+ {
+ static int const value = std::numeric_limits<T>::digits10;
+ };
+
///////////////////////////////////////////////////////////////////////////
//
// Traits class for radix specific number conversion
@@ -114,12 +128,6 @@ namespace boost { namespace spirit { namespace qi { namespace detail
return spirit::char_encoding::ascii::tolower(ch) - 'a' + 10;
}
};
-
- template <typename T, T Val>
- struct constexpr_int
- {
- BOOST_STATIC_CONSTEXPR T value = Val;
- };
///////////////////////////////////////////////////////////////////////////
// positive_accumulator/negative_accumulator: Accumulator policies for
@@ -140,20 +148,20 @@ namespace boost { namespace spirit { namespace qi { namespace detail
inline static bool add(T& n, Char ch, mpl::true_) // checked add
{
// Ensure n *= Radix will not overflow
- typedef constexpr_int<T, boost::integer_traits<T>::const_max> max;
- typedef constexpr_int<T, max::value / Radix> val;
+ T const max = (std::numeric_limits<T>::max)();
+ T const val = max / Radix;
- if (n > val::value)
+ if (n > val)
return false;
- n *= Radix;
+ T tmp = n * Radix;
// Ensure n += digit will not overflow
const int digit = radix_traits<Radix>::digit(ch);
- if (n > max::value - digit)
+ if (tmp > max - digit)
return false;
- n += static_cast<T>(digit);
+ n = tmp + static_cast<T>(digit);
return true;
}
};
@@ -172,20 +180,20 @@ namespace boost { namespace spirit { namespace qi { namespace detail
inline static bool add(T& n, Char ch, mpl::true_) // checked subtract
{
// Ensure n *= Radix will not underflow
- typedef constexpr_int<T, boost::integer_traits<T>::const_min> min;
- typedef constexpr_int<T, (min::value + 1) / T(Radix)> val;
+ T const min = (std::numeric_limits<T>::min)();
+ T const val = min / T(Radix);
- if (n < val::value)
+ if (n < val)
return false;
- n *= Radix;
+ T tmp = n * Radix;
// Ensure n -= digit will not underflow
int const digit = radix_traits<Radix>::digit(ch);
- if (n < min::value + digit)
+ if (tmp < min + digit)
return false;
- n -= static_cast<T>(digit);
+ n = tmp - static_cast<T>(digit);
return true;
}
};
@@ -200,9 +208,9 @@ namespace boost { namespace spirit { namespace qi { namespace detail
inline static bool
call(Char ch, std::size_t count, T& n, mpl::true_)
{
- typedef constexpr_int<std::size_t, digits_traits<T, Radix>::value - 1> overflow_free;
+ std::size_t const overflow_free = digits_traits<T, Radix>::value - 1;
- if (!AlwaysCheckOverflow && (count < overflow_free::value))
+ if (!AlwaysCheckOverflow && (count < overflow_free))
{
Accumulator::add(n, ch, mpl::false_());
}
@@ -318,9 +326,7 @@ namespace boost { namespace spirit { namespace qi { namespace detail
{
typedef radix_traits<Radix> radix_check;
typedef int_extractor<Radix, Accumulator, MaxDigits, Accumulate> extractor;
- typedef typename
- boost::detail::iterator_traits<Iterator>::value_type
- char_type;
+ typedef typename std::iterator_traits<Iterator>::value_type char_type;
Iterator it = first;
std::size_t leading_zeros = 0;
@@ -423,9 +429,7 @@ namespace boost { namespace spirit { namespace qi { namespace detail
{
typedef radix_traits<Radix> radix_check;
typedef int_extractor<Radix, Accumulator, -1, Accumulate> extractor;
- typedef typename
- boost::detail::iterator_traits<Iterator>::value_type
- char_type;
+ typedef typename std::iterator_traits<Iterator>::value_type char_type;
Iterator it = first;
std::size_t count = 0;
diff --git a/boost/spirit/home/qi/numeric/detail/real_impl.hpp b/boost/spirit/home/qi/numeric/detail/real_impl.hpp
index c8d20876fa..43a51dae8a 100644
--- a/boost/spirit/home/qi/numeric/detail/real_impl.hpp
+++ b/boost/spirit/home/qi/numeric/detail/real_impl.hpp
@@ -151,20 +151,6 @@ namespace boost { namespace spirit { namespace traits
}
template <typename T>
- inline bool
- is_equal_to_one(T const& value)
- {
- return value == 1.0;
- }
-
- inline bool
- is_equal_to_one(unused_type)
- {
- // no-op for unused_type
- return false;
- }
-
- template <typename T>
struct real_accumulator : mpl::identity<T> {};
template <>
@@ -297,22 +283,6 @@ namespace boost { namespace spirit { namespace qi { namespace detail
bool r = traits::scale(-frac_digits, n, acc_n);
BOOST_VERIFY(r);
}
- else if (traits::is_equal_to_one(acc_n))
- {
- // There is a chance of having to parse one of the 1.0#...
- // styles some implementations use for representing NaN or Inf.
-
- // Check whether the number to parse is a NaN or Inf
- if (p.parse_nan(first, last, n) ||
- p.parse_inf(first, last, n))
- {
- // If we got a negative sign, negate the number
- traits::assign_to(traits::negate(neg, n), attr);
- return true; // got a NaN or Inf, return immediately
- }
-
- n = static_cast<T>(acc_n);
- }
else
{
n = static_cast<T>(acc_n);
diff --git a/boost/spirit/home/qi/numeric/real_policies.hpp b/boost/spirit/home/qi/numeric/real_policies.hpp
index d73a9dce8a..48cf2b97a5 100644
--- a/boost/spirit/home/qi/numeric/real_policies.hpp
+++ b/boost/spirit/home/qi/numeric/real_policies.hpp
@@ -89,22 +89,9 @@ namespace boost { namespace spirit { namespace qi
}
///////////////////////////////////////////////////////////////////////
- // The parse_nan() and parse_inf() functions get called whenever:
- //
- // - a number to parse does not start with a digit (after having
- // successfully parsed an optional sign)
- //
- // or
- //
- // - after a floating point number of the value 1 (having no
- // exponential part and a fractional part value of 0) has been
- // parsed.
- //
- // The first call allows to recognize representations of NaN or Inf
- // starting with a non-digit character (such as NaN, Inf, QNaN etc.).
- //
- // The second call allows to recognize representation formats starting
- // with a 1.0 (such as 1.0#NAN or 1.0#INF etc.).
+ // The parse_nan() and parse_inf() functions get called whenever
+ // a number to parse does not start with a digit (after having
+ // successfully parsed an optional sign).
//
// The functions should return true if a Nan or Inf has been found. In
// this case the attr should be set to the matched value (NaN or
diff --git a/boost/spirit/home/qi/stream/detail/iterator_source.hpp b/boost/spirit/home/qi/stream/detail/iterator_source.hpp
index 4e93c84f6d..abb7fe028b 100644
--- a/boost/spirit/home/qi/stream/detail/iterator_source.hpp
+++ b/boost/spirit/home/qi/stream/detail/iterator_source.hpp
@@ -12,7 +12,7 @@
#endif
#include <boost/iostreams/stream.hpp>
-#include <boost/detail/iterator.hpp>
+#include <iterator> // for std::iterator_traits, std::distance
///////////////////////////////////////////////////////////////////////////////
namespace boost { namespace spirit { namespace qi { namespace detail
@@ -21,9 +21,7 @@ namespace boost { namespace spirit { namespace qi { namespace detail
template <typename Iterator>
struct base_iterator_source
{
- typedef typename
- boost::detail::iterator_traits<Iterator>::value_type
- char_type;
+ typedef typename std::iterator_traits<Iterator>::value_type char_type;
typedef boost::iostreams::seekable_device_tag category;
base_iterator_source (Iterator const& first_, Iterator const& last_)
@@ -62,6 +60,7 @@ namespace boost { namespace spirit { namespace qi { namespace detail
std::streampos seek(boost::iostreams::stream_offset, std::ios_base::seekdir way)
{
+ (void)way;
BOOST_ASSERT(way == std::ios_base::cur); // only support queries
return pos; // return current position
}
@@ -90,7 +89,7 @@ namespace boost { namespace spirit { namespace qi { namespace detail
struct iterator_source<
Iterator,
typename boost::enable_if_c<boost::is_convertible<
- typename boost::detail::iterator_traits<Iterator>::iterator_category, std::random_access_iterator_tag>::value>::type
+ typename std::iterator_traits<Iterator>::iterator_category, std::random_access_iterator_tag>::value>::type
> : base_iterator_source<Iterator>
{
typedef base_iterator_source<Iterator> base_type;
@@ -111,13 +110,13 @@ namespace boost { namespace spirit { namespace qi { namespace detail
if (first == last)
return -1;
- n = std::min BOOST_PREVENT_MACRO_SUBSTITUTION(
- static_cast<std::streamsize>(std::distance(first, last)),
- n);
+ n = (std::min)(static_cast<std::streamsize>(last - first), n);
+
+ typedef typename std::iterator_traits<Iterator>::difference_type diff_type;
// copy_n is only part of c++11, so emulate it
- std::copy(first, first + n, s);
- first += n;
+ std::copy(first, first + static_cast<diff_type>(n), s);
+ first += static_cast<diff_type>(n);
pos += n;
return n;
diff --git a/boost/spirit/home/qi/string/detail/tst.hpp b/boost/spirit/home/qi/string/detail/tst.hpp
index 4f551d289e..68c5ec3d30 100644
--- a/boost/spirit/home/qi/string/detail/tst.hpp
+++ b/boost/spirit/home/qi/string/detail/tst.hpp
@@ -12,7 +12,7 @@
#endif
#include <boost/call_traits.hpp>
-#include <boost/detail/iterator.hpp>
+#include <iterator> // for std::iterator_traits
namespace boost { namespace spirit { namespace qi { namespace detail
{
@@ -74,7 +74,7 @@ namespace boost { namespace spirit { namespace qi { namespace detail
while (p && i != last)
{
typename
- boost::detail::iterator_traits<Iterator>::value_type
+ std::iterator_traits<Iterator>::value_type
c = filter(*i); // filter only the input
if (c == p->id)
@@ -118,7 +118,7 @@ namespace boost { namespace spirit { namespace qi { namespace detail
for(;;)
{
typename
- boost::detail::iterator_traits<Iterator>::value_type
+ std::iterator_traits<Iterator>::value_type
c = *first;
if (*pp == 0)
@@ -154,7 +154,7 @@ namespace boost { namespace spirit { namespace qi { namespace detail
return;
typename
- boost::detail::iterator_traits<Iterator>::value_type
+ std::iterator_traits<Iterator>::value_type
c = *first;
if (c == p->id)
diff --git a/boost/spirit/home/qi/string/symbols.hpp b/boost/spirit/home/qi/string/symbols.hpp
index 081632438c..e54a3c6558 100644
--- a/boost/spirit/home/qi/string/symbols.hpp
+++ b/boost/spirit/home/qi/string/symbols.hpp
@@ -24,9 +24,8 @@
#include <boost/spirit/home/support/unused.hpp>
#include <boost/spirit/home/support/string_traits.hpp>
-#include <boost/fusion/include/at.hpp>
-#include <boost/range.hpp>
-#include <boost/type_traits/add_reference.hpp>
+#include <boost/range/begin.hpp>
+#include <boost/range/end.hpp>
#include <boost/shared_ptr.hpp>
#if defined(BOOST_MSVC)
diff --git a/boost/spirit/home/support/attributes.hpp b/boost/spirit/home/support/attributes.hpp
index 960a8af240..11472030dc 100644
--- a/boost/spirit/home/support/attributes.hpp
+++ b/boost/spirit/home/support/attributes.hpp
@@ -28,9 +28,9 @@
#include <boost/fusion/include/for_each.hpp>
#include <boost/fusion/include/is_view.hpp>
#include <boost/fusion/include/mpl.hpp>
-#include <boost/utility/value_init.hpp>
#include <boost/type_traits/is_same.hpp>
#include <boost/type_traits/is_convertible.hpp>
+#include <boost/type_traits/is_reference.hpp>
#include <boost/mpl/eval_if.hpp>
#include <boost/mpl/end.hpp>
#include <boost/mpl/find_if.hpp>
@@ -45,6 +45,7 @@
#include <boost/variant.hpp>
#include <boost/range/iterator_range.hpp>
#include <boost/config.hpp>
+#include <iterator> // for std::iterator_traits, std::distance
#include <vector>
#include <utility>
#include <ios>
@@ -559,12 +560,12 @@ namespace boost { namespace spirit { namespace traits
template <typename Iterator>
struct attribute_size<iterator_range<Iterator> >
{
- typedef typename boost::detail::iterator_traits<Iterator>::
+ typedef typename std::iterator_traits<Iterator>::
difference_type type;
static type call(iterator_range<Iterator> const& r)
{
- return boost::detail::distance(r.begin(), r.end());
+ return std::distance(r.begin(), r.end());
}
};
@@ -930,6 +931,15 @@ namespace boost { namespace spirit { namespace traits
// specializations are dispatched via intermediate type.
template <typename Exposed, typename Transformed, typename Domain>
struct transform_attribute_base;
+
+ template <typename Attribute>
+ struct synthesize_attribute
+ {
+ typedef Attribute type;
+ static Attribute pre(unused_type) { return Attribute(); }
+ static void post(unused_type, Attribute const&) {}
+ static void fail(unused_type) {}
+ };
}
///////////////////////////////////////////////////////////////////////////
// transform_attribute
@@ -938,93 +948,32 @@ namespace boost { namespace spirit { namespace traits
// attributes. This template can be used as a customization point, where
// the user is able specify specific transformation rules for any attribute
// type.
+ //
+ // Note: the transformations involving unused_type are internal details
+ // and may be subject to change at any time.
+ //
///////////////////////////////////////////////////////////////////////////
template <typename Exposed, typename Transformed, typename Domain
, typename Enable/* = void*/>
struct transform_attribute
: detail::transform_attribute_base<Exposed, Transformed, Domain>
- {};
-
- ///////////////////////////////////////////////////////////////////////////
- template <typename Domain, typename Transformed, typename Exposed>
- typename spirit::result_of::pre_transform<Exposed, Transformed, Domain>::type
- pre_transform(Exposed& attr BOOST_PROTO_DISABLE_IF_IS_CONST(Exposed))
{
- return transform_attribute<Exposed, Transformed, Domain>::pre(attr);
- }
-
- template <typename Domain, typename Transformed, typename Exposed>
- typename spirit::result_of::pre_transform<Exposed const, Transformed, Domain>::type
- pre_transform(Exposed const& attr)
- {
- return transform_attribute<Exposed const, Transformed, Domain>::pre(attr);
- }
-
- ///////////////////////////////////////////////////////////////////////////
- // make_attribute
- //
- // All parsers and generators have specific attribute types.
- // Spirit parsers and generators are passed an attribute; these are either
- // references to the expected type, or an unused_type -- to flag that we do
- // not care about the attribute. For semantic actions, however, we need to
- // have a real value to pass to the semantic action. If the client did not
- // provide one, we will have to synthesize the value. This class takes care
- // of that. *Note that this behavior has changed. From Boost 1.47, semantic
- // actions always take in the passed attribute as-is if the PP constant:
- // BOOST_SPIRIT_ACTIONS_ALLOW_ATTR_COMPAT is defined.
- ///////////////////////////////////////////////////////////////////////////
- template <typename Attribute, typename ActualAttribute>
- struct make_attribute
- {
- typedef typename remove_const<Attribute>::type attribute_type;
- typedef typename
- mpl::if_<
- is_same<typename remove_const<ActualAttribute>::type, unused_type>
- , attribute_type
- , ActualAttribute&>::type
- type;
-
- typedef typename
- mpl::if_<
- is_same<typename remove_const<ActualAttribute>::type, unused_type>
- , attribute_type
- , ActualAttribute>::type
- value_type;
-
- static Attribute call(unused_type)
- {
- // synthesize the attribute/parameter
- return boost::get(value_initialized<attribute_type>());
- }
-
- template <typename T>
- static T& call(T& value)
- {
- return value; // just pass the one provided
- }
+ BOOST_STATIC_ASSERT_MSG(!is_reference<Exposed>::value,
+ "Exposed cannot be a reference type");
+ BOOST_STATIC_ASSERT_MSG(!is_reference<Transformed>::value,
+ "Transformed cannot be a reference type");
};
- template <typename Attribute, typename ActualAttribute>
- struct make_attribute<Attribute&, ActualAttribute>
- : make_attribute<Attribute, ActualAttribute>
+ template <typename Transformed, typename Domain>
+ struct transform_attribute<unused_type, Transformed, Domain>
+ : detail::synthesize_attribute<Transformed>
{};
- template <typename Attribute, typename ActualAttribute>
- struct make_attribute<Attribute const&, ActualAttribute>
- : make_attribute<Attribute const, ActualAttribute>
+ template <typename Transformed, typename Domain>
+ struct transform_attribute<unused_type const, Transformed, Domain>
+ : detail::synthesize_attribute<Transformed>
{};
- template <typename ActualAttribute>
- struct make_attribute<unused_type, ActualAttribute>
- {
- typedef unused_type type;
- typedef unused_type value_type;
- static unused_type call(unused_type)
- {
- return unused;
- }
- };
-
///////////////////////////////////////////////////////////////////////////
// swap_impl
//
@@ -1391,14 +1340,4 @@ namespace boost { namespace spirit { namespace traits
}
}}}
-///////////////////////////////////////////////////////////////////////////////
-namespace boost { namespace spirit { namespace result_of
-{
- template <typename Exposed, typename Transformed, typename Domain>
- struct pre_transform
- : traits::transform_attribute<Exposed, Transformed, Domain>
- {};
-}}}
-
-
#endif
diff --git a/boost/spirit/home/support/attributes_fwd.hpp b/boost/spirit/home/support/attributes_fwd.hpp
index 6086d3709d..a9a62fedb5 100644
--- a/boost/spirit/home/support/attributes_fwd.hpp
+++ b/boost/spirit/home/support/attributes_fwd.hpp
@@ -30,9 +30,6 @@ namespace boost { namespace spirit { namespace result_of
template <typename T, typename Attribute>
struct attribute_as;
- template <typename Exposed, typename Transformed, typename Domain>
- struct pre_transform;
-
template <typename T>
struct optional_value;
diff --git a/boost/spirit/home/support/container.hpp b/boost/spirit/home/support/container.hpp
index 5e154cdb7b..f6fc056909 100644
--- a/boost/spirit/home/support/container.hpp
+++ b/boost/spirit/home/support/container.hpp
@@ -15,7 +15,6 @@
#include <boost/spirit/home/support/unused.hpp>
#include <boost/spirit/home/support/attributes_fwd.hpp>
-#include <boost/detail/iterator.hpp> // for boost::detail::iterator_traits
#include <boost/mpl/has_xxx.hpp>
#include <boost/mpl/bool.hpp>
#include <boost/optional.hpp>
@@ -23,6 +22,7 @@
#include <boost/preprocessor/cat.hpp>
#include <boost/preprocessor/repeat.hpp>
#include <boost/range/iterator_range.hpp>
+#include <iterator> // for std::iterator_traits
namespace boost { namespace spirit { namespace traits
{
@@ -465,7 +465,7 @@ namespace boost { namespace spirit { namespace traits
template <typename Iterator, typename Enable/* = void*/>
struct deref_iterator
{
- typedef typename boost::detail::iterator_traits<Iterator>::reference type;
+ typedef typename std::iterator_traits<Iterator>::reference type;
static type call(Iterator& it)
{
return *it;
diff --git a/boost/spirit/home/support/detail/endian/endian.hpp b/boost/spirit/home/support/detail/endian/endian.hpp
index 8ee91c1e63..6211e680f1 100644
--- a/boost/spirit/home/support/detail/endian/endian.hpp
+++ b/boost/spirit/home/support/detail/endian/endian.hpp
@@ -35,8 +35,12 @@
#include <boost/config.hpp>
#include <boost/predef/other/endian.h>
+#ifndef BOOST_MINIMAL_INTEGER_COVER_OPERATORS
#define BOOST_MINIMAL_INTEGER_COVER_OPERATORS
+#endif
+#ifndef BOOST_NO_IO_COVER_OPERATORS
#define BOOST_NO_IO_COVER_OPERATORS
+#endif
#include <boost/spirit/home/support/detail/endian/cover_operators.hpp>
#undef BOOST_NO_IO_COVER_OPERATORS
#undef BOOST_MINIMAL_INTEGER_COVER_OPERATORS
@@ -52,10 +56,10 @@
# error Platforms with CHAR_BIT != 8 are not supported
# endif
-# define BOOST_ENDIAN_DEFAULT_CONSTRUCT {} // C++03
+# define BOOST_SPIRIT_ENDIAN_DEFAULT_CONSTRUCT {} // C++03
-# if defined(BOOST_ENDIAN_FORCE_PODNESS)
-# define BOOST_ENDIAN_NO_CTORS
+# if defined(BOOST_ENDIAN_NO_CTORS) || defined(BOOST_ENDIAN_FORCE_PODNESS)
+# define BOOST_SPIRIT_ENDIAN_NO_CTORS
# endif
@@ -315,8 +319,8 @@ namespace boost { namespace spirit
BOOST_STATIC_ASSERT( (n_bits/8)*8 == n_bits );
public:
typedef T value_type;
-# ifndef BOOST_ENDIAN_NO_CTORS
- endian() BOOST_ENDIAN_DEFAULT_CONSTRUCT
+# ifndef BOOST_SPIRIT_ENDIAN_NO_CTORS
+ endian() BOOST_SPIRIT_ENDIAN_DEFAULT_CONSTRUCT
explicit endian(T val)
{
# ifdef BOOST_ENDIAN_LOG
@@ -347,8 +351,8 @@ namespace boost { namespace spirit
BOOST_STATIC_ASSERT( (n_bits/8)*8 == n_bits );
public:
typedef T value_type;
-# ifndef BOOST_ENDIAN_NO_CTORS
- endian() BOOST_ENDIAN_DEFAULT_CONSTRUCT
+# ifndef BOOST_SPIRIT_ENDIAN_NO_CTORS
+ endian() BOOST_SPIRIT_ENDIAN_DEFAULT_CONSTRUCT
explicit endian(T val)
{
# ifdef BOOST_ENDIAN_LOG
@@ -379,8 +383,8 @@ namespace boost { namespace spirit
BOOST_STATIC_ASSERT( (n_bits/8)*8 == n_bits );
public:
typedef T value_type;
-# ifndef BOOST_ENDIAN_NO_CTORS
- endian() BOOST_ENDIAN_DEFAULT_CONSTRUCT
+# ifndef BOOST_SPIRIT_ENDIAN_NO_CTORS
+ endian() BOOST_SPIRIT_ENDIAN_DEFAULT_CONSTRUCT
# if BOOST_ENDIAN_BIG_BYTE
explicit endian(T val) { detail::store_big_endian<T, n_bits/8>(m_value, val); }
# else
@@ -410,8 +414,8 @@ namespace boost { namespace spirit
BOOST_STATIC_ASSERT( sizeof(T) == n_bits/8 );
public:
typedef T value_type;
-# ifndef BOOST_ENDIAN_NO_CTORS
- endian() BOOST_ENDIAN_DEFAULT_CONSTRUCT
+# ifndef BOOST_SPIRIT_ENDIAN_NO_CTORS
+ endian() BOOST_SPIRIT_ENDIAN_DEFAULT_CONSTRUCT
# if BOOST_ENDIAN_BIG_BYTE
endian(T val) : m_value(val) { }
# else
@@ -438,8 +442,8 @@ namespace boost { namespace spirit
BOOST_STATIC_ASSERT( sizeof(T) == n_bits/8 );
public:
typedef T value_type;
-# ifndef BOOST_ENDIAN_NO_CTORS
- endian() BOOST_ENDIAN_DEFAULT_CONSTRUCT
+# ifndef BOOST_SPIRIT_ENDIAN_NO_CTORS
+ endian() BOOST_SPIRIT_ENDIAN_DEFAULT_CONSTRUCT
# if BOOST_ENDIAN_LITTLE_BYTE
endian(T val) : m_value(val) { }
# else
@@ -519,10 +523,6 @@ namespace boost { namespace spirit
typedef endian< endianness::native, uint_least64_t, 56 > unative56_t;
typedef endian< endianness::native, uint_least64_t, 64 > unative64_t;
-#define BOOST_HAS_INT16_T
-#define BOOST_HAS_INT32_T
-#define BOOST_HAS_INT64_T
-
// These types only present if platform has exact size integers:
// aligned big endian signed integer types
// aligned big endian unsigned integer types
@@ -532,35 +532,32 @@ namespace boost { namespace spirit
// aligned native endian typedefs are not provided because
// <cstdint> types are superior for this use case
-# if defined(BOOST_HAS_INT16_T)
+#ifdef INT16_MAX
typedef endian< endianness::big, int16_t, 16, alignment::aligned > aligned_big16_t;
typedef endian< endianness::big, uint16_t, 16, alignment::aligned > aligned_ubig16_t;
typedef endian< endianness::little, int16_t, 16, alignment::aligned > aligned_little16_t;
typedef endian< endianness::little, uint16_t, 16, alignment::aligned > aligned_ulittle16_t;
-# endif
+#endif
-# if defined(BOOST_HAS_INT32_T)
+#ifdef INT32_MAX
typedef endian< endianness::big, int32_t, 32, alignment::aligned > aligned_big32_t;
typedef endian< endianness::big, uint32_t, 32, alignment::aligned > aligned_ubig32_t;
typedef endian< endianness::little, int32_t, 32, alignment::aligned > aligned_little32_t;
typedef endian< endianness::little, uint32_t, 32, alignment::aligned > aligned_ulittle32_t;
-# endif
+#endif
-# if defined(BOOST_HAS_INT64_T)
+#ifdef INT64_MAX
typedef endian< endianness::big, int64_t, 64, alignment::aligned > aligned_big64_t;
typedef endian< endianness::big, uint64_t, 64, alignment::aligned > aligned_ubig64_t;
typedef endian< endianness::little, int64_t, 64, alignment::aligned > aligned_little64_t;
typedef endian< endianness::little, uint64_t, 64, alignment::aligned > aligned_ulittle64_t;
-# endif
+#endif
} // namespace endian
}} // namespace boost::spirit
-// import the namespace above into boost::endian
-namespace boost { namespace endian
-{
- using namespace boost::spirit::endian;
-}}
+#undef BOOST_SPIRIT_ENDIAN_DEFAULT_CONSTRUCT
+#undef BOOST_SPIRIT_ENDIAN_NO_CTORS
#if defined(__BORLANDC__) || defined( __CODEGEARC__)
# pragma pack(pop)
diff --git a/boost/spirit/home/support/detail/hold_any.hpp b/boost/spirit/home/support/detail/hold_any.hpp
index e03e3f1731..d8b08dc1ee 100644
--- a/boost/spirit/home/support/detail/hold_any.hpp
+++ b/boost/spirit/home/support/detail/hold_any.hpp
@@ -49,7 +49,7 @@ namespace boost { namespace spirit
: from(src.name()), to(dest.name())
{}
- virtual const char* what() const throw() { return "bad any cast"; }
+ virtual const char* what() const BOOST_NOEXCEPT_OR_NOTHROW { return "bad any cast"; }
const char* from;
const char* to;
diff --git a/boost/spirit/home/support/detail/lexer/generate_cpp.hpp b/boost/spirit/home/support/detail/lexer/generate_cpp.hpp
index f1f05536b8..2620c46fd8 100644
--- a/boost/spirit/home/support/detail/lexer/generate_cpp.hpp
+++ b/boost/spirit/home/support/detail/lexer/generate_cpp.hpp
@@ -10,7 +10,6 @@
#include "consts.hpp"
#include "internals.hpp"
#include <iostream>
-#include <boost/detail/iterator.hpp>
#include "runtime_error.hpp"
#include "size_t.hpp"
#include "state_machine.hpp"
diff --git a/boost/spirit/home/support/detail/lexer/input.hpp b/boost/spirit/home/support/detail/lexer/input.hpp
index e0a5ecc819..c7834c10c2 100644
--- a/boost/spirit/home/support/detail/lexer/input.hpp
+++ b/boost/spirit/home/support/detail/lexer/input.hpp
@@ -7,16 +7,16 @@
#define BOOST_LEXER_INPUT
#include "char_traits.hpp"
-#include <boost/detail/iterator.hpp>
#include "size_t.hpp"
#include "state_machine.hpp"
+#include <iterator> // for std::iterator_traits
namespace boost
{
namespace lexer
{
template<typename FwdIter, typename Traits =
- char_traits<typename boost::detail::iterator_traits<FwdIter>::value_type> >
+ char_traits<typename std::iterator_traits<FwdIter>::value_type> >
class basic_input
{
public:
diff --git a/boost/spirit/home/support/detail/lexer/serialise.hpp b/boost/spirit/home/support/detail/lexer/serialise.hpp
deleted file mode 100644
index 3a2ff1fa08..0000000000
--- a/boost/spirit/home/support/detail/lexer/serialise.hpp
+++ /dev/null
@@ -1,35 +0,0 @@
-// examples/serialise.hpp
-// Copyright (c) 2007-2009 Ben Hanson (http://www.benhanson.net/)
-//
-// Distributed under the Boost Software License, Version 1.0. (See accompanying
-// file licence_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
-#ifndef BOOST_LEXER_SERIALISE_HPP
-#define BOOST_LEXER_SERIALISE_HPP
-
-#include "internals.hpp"
-#include "state_machine.hpp"
-#include <boost/serialization/vector.hpp>
-
-namespace boost
-{
-namespace lexer
-{
-// IMPORTANT! This won't work if you don't enable RTTI!
-template<typename CharT, class Archive>
-void serialise (basic_state_machine<CharT> &sm_, Archive &ar_,
- unsigned int version_ = 1)
-{
- detail::internals &internals_ = const_cast<detail::internals &>
- (sm_.data ());
-
- ar_ & version_;
- ar_ & *internals_._lookup;
- ar_ & internals_._dfa_alphabet;
- ar_ & *internals_._dfa;
- ar_ & internals_._seen_BOL_assertion;
- ar_ & internals_._seen_EOL_assertion;
-}
-}
-}
-
-#endif
diff --git a/boost/spirit/home/support/iterators/detail/buf_id_check_policy.hpp b/boost/spirit/home/support/iterators/detail/buf_id_check_policy.hpp
index e732330354..fd37e60b25 100644
--- a/boost/spirit/home/support/iterators/detail/buf_id_check_policy.hpp
+++ b/boost/spirit/home/support/iterators/detail/buf_id_check_policy.hpp
@@ -23,10 +23,10 @@ namespace boost { namespace spirit { namespace iterator_policies
class BOOST_SYMBOL_VISIBLE illegal_backtracking : public std::exception
{
public:
- illegal_backtracking() throw() {}
- ~illegal_backtracking() throw() {}
+ illegal_backtracking() BOOST_NOEXCEPT_OR_NOTHROW {}
+ ~illegal_backtracking() BOOST_NOEXCEPT_OR_NOTHROW {}
- char const* what() const throw()
+ char const* what() const BOOST_NOEXCEPT_OR_NOTHROW
{
return "boost::spirit::multi_pass::illegal_backtracking";
}
diff --git a/boost/spirit/home/support/iterators/detail/buffering_input_iterator_policy.hpp b/boost/spirit/home/support/iterators/detail/buffering_input_iterator_policy.hpp
index c5cc430817..1144d4ee5d 100644
--- a/boost/spirit/home/support/iterators/detail/buffering_input_iterator_policy.hpp
+++ b/boost/spirit/home/support/iterators/detail/buffering_input_iterator_policy.hpp
@@ -10,8 +10,8 @@
#include <boost/spirit/home/support/iterators/multi_pass_fwd.hpp>
#include <boost/spirit/home/support/iterators/detail/multi_pass.hpp>
#include <boost/spirit/home/support/iterators/detail/input_iterator_policy.hpp>
-#include <boost/detail/iterator.hpp> // for boost::detail::iterator_traits
#include <boost/assert.hpp>
+#include <iterator> // for std::iterator_traits
namespace boost { namespace spirit { namespace iterator_policies
{
@@ -35,18 +35,18 @@ namespace boost { namespace spirit { namespace iterator_policies
{
private:
typedef
- typename boost::detail::iterator_traits<T>::value_type
+ typename std::iterator_traits<T>::value_type
result_type;
public:
typedef
- typename boost::detail::iterator_traits<T>::difference_type
+ typename std::iterator_traits<T>::difference_type
difference_type;
typedef
- typename boost::detail::iterator_traits<T>::difference_type
+ typename std::iterator_traits<T>::difference_type
distance_type;
typedef
- typename boost::detail::iterator_traits<T>::pointer
+ typename std::iterator_traits<T>::pointer
pointer;
typedef result_type& reference;
typedef result_type value_type;
@@ -96,7 +96,7 @@ namespace boost { namespace spirit { namespace iterator_policies
struct shared
{
typedef
- typename boost::detail::iterator_traits<T>::value_type
+ typename std::iterator_traits<T>::value_type
result_type;
explicit shared(T const& input)
diff --git a/boost/spirit/home/support/iterators/detail/input_iterator_policy.hpp b/boost/spirit/home/support/iterators/detail/input_iterator_policy.hpp
index f2e81e85ac..4a74b684a4 100644
--- a/boost/spirit/home/support/iterators/detail/input_iterator_policy.hpp
+++ b/boost/spirit/home/support/iterators/detail/input_iterator_policy.hpp
@@ -9,8 +9,8 @@
#include <boost/spirit/home/support/iterators/multi_pass_fwd.hpp>
#include <boost/spirit/home/support/iterators/detail/multi_pass.hpp>
-#include <boost/detail/iterator.hpp> // for boost::detail::iterator_traits
#include <boost/assert.hpp>
+#include <iterator> // for std::iterator_traits
namespace boost { namespace spirit { namespace iterator_policies
{
@@ -38,21 +38,21 @@ namespace boost { namespace spirit { namespace iterator_policies
{
private:
typedef
- typename boost::detail::iterator_traits<T>::value_type
+ typename std::iterator_traits<T>::value_type
result_type;
public:
typedef
- typename boost::detail::iterator_traits<T>::difference_type
+ typename std::iterator_traits<T>::difference_type
difference_type;
typedef
- typename boost::detail::iterator_traits<T>::difference_type
+ typename std::iterator_traits<T>::difference_type
distance_type;
typedef
- typename boost::detail::iterator_traits<T>::pointer
+ typename std::iterator_traits<T>::pointer
pointer;
typedef
- typename boost::detail::iterator_traits<T>::reference
+ typename std::iterator_traits<T>::reference
reference;
typedef result_type value_type;
diff --git a/boost/spirit/home/support/numeric_traits.hpp b/boost/spirit/home/support/numeric_traits.hpp
index 01771dd982..9e03fe06f7 100644
--- a/boost/spirit/home/support/numeric_traits.hpp
+++ b/boost/spirit/home/support/numeric_traits.hpp
@@ -11,9 +11,8 @@
#endif
#include <boost/config.hpp>
+#include <boost/limits.hpp>
#include <boost/mpl/bool.hpp>
-#include <boost/integer_traits.hpp>
-#include <boost/utility/enable_if.hpp>
namespace boost { namespace spirit { namespace traits
{
@@ -115,13 +114,9 @@ namespace boost { namespace spirit { namespace traits
template <typename T, typename Enable = void>
struct is_infinite;
-
+
template <typename T, typename Enable = void>
- struct check_overflow : mpl::false_ {};
-
- template <typename T>
- struct check_overflow<T, typename enable_if_c<integer_traits<T>::is_integral>::type>
- : mpl::true_ {};
+ struct check_overflow : mpl::bool_<std::numeric_limits<T>::is_bounded> {};
}}}
#endif
diff --git a/boost/spirit/home/support/utree/detail/utree_detail2.hpp b/boost/spirit/home/support/utree/detail/utree_detail2.hpp
index cc3cb2fd43..ff6dd76e7b 100644
--- a/boost/spirit/home/support/utree/detail/utree_detail2.hpp
+++ b/boost/spirit/home/support/utree/detail/utree_detail2.hpp
@@ -44,13 +44,15 @@ namespace boost { namespace spirit { namespace detail
inline short fast_string::tag() const
{
- return (int(buff[small_string_size-2]) << 8) + (unsigned char)buff[small_string_size-1];
+ boost::int16_t tmp;
+ std::memcpy(&tmp, &buff[small_string_size-2], sizeof(tmp));
+ return tmp;
}
inline void fast_string::tag(short tag)
{
- buff[small_string_size-2] = tag >> 8;
- buff[small_string_size-1] = tag & 0xff;
+ boost::int16_t tmp = tag;
+ std::memcpy(&buff[small_string_size-2], &tmp, sizeof(tmp));
}
inline bool fast_string::is_heap_allocated() const
@@ -931,11 +933,11 @@ namespace boost { namespace spirit
return *this;
}
- inline utree& utree::operator=(any_ptr const& p)
+ inline utree& utree::operator=(any_ptr const& p_)
{
free();
- v.p = p.p;
- v.i = p.i;
+ v.p = p_.p;
+ v.i = p_.i;
set_type(type::any_type);
return *this;
}
diff --git a/boost/spirit/home/support/utree/operators.hpp b/boost/spirit/home/support/utree/operators.hpp
index 39b1d64ac5..1858ef4cfd 100644
--- a/boost/spirit/home/support/utree/operators.hpp
+++ b/boost/spirit/home/support/utree/operators.hpp
@@ -535,7 +535,14 @@ namespace boost { namespace spirit
BOOST_SPIRIT_UTREE_CREATE_INTEGRAL_FUNCTION(bitxor_, a^b)
BOOST_SPIRIT_UTREE_CREATE_INTEGRAL_FUNCTION(shift_left, a<<b)
BOOST_SPIRIT_UTREE_CREATE_INTEGRAL_FUNCTION(shift_right, a>>b)
+#if defined(__GNUC__) && (__GNUC__ >= 7)
+# pragma GCC diagnostic push
+# pragma GCC diagnostic ignored "-Wbool-operation" // '~' on an expression of type bool
+#endif
BOOST_SPIRIT_UTREE_CREATE_INTEGRAL_FUNCTION(invert, ~a)
+#if defined(__GNUC__) && (__GNUC__ >= 7)
+# pragma GCC diagnostic pop
+#endif
inline utree operator&&(utree const& a, utree const& b)
{
diff --git a/boost/spirit/home/support/utree/utree.hpp b/boost/spirit/home/support/utree/utree.hpp
index a00fcffbf3..68d62dc6b6 100644
--- a/boost/spirit/home/support/utree/utree.hpp
+++ b/boost/spirit/home/support/utree/utree.hpp
@@ -29,6 +29,7 @@
#include <boost/utility/enable_if.hpp>
#include <boost/utility/result_of.hpp>
#include <boost/ref.hpp>
+#include <boost/config.hpp>
#include <boost/spirit/home/support/utree/detail/utree_detail1.hpp>
@@ -143,9 +144,9 @@ namespace boost { namespace spirit
msg = oss.str();
}
- virtual ~bad_type_exception() throw() {}
+ virtual ~bad_type_exception() BOOST_NOEXCEPT_OR_NOTHROW {}
- virtual char const* what() const throw()
+ virtual char const* what() const BOOST_NOEXCEPT_OR_NOTHROW
{ return msg.c_str(); }
};
@@ -155,9 +156,9 @@ namespace boost { namespace spirit
empty_exception(char const* error) : msg(error) {}
- virtual ~empty_exception() throw() {}
+ virtual ~empty_exception() BOOST_NOEXCEPT_OR_NOTHROW {}
- virtual char const* what() const throw()
+ virtual char const* what() const BOOST_NOEXCEPT_OR_NOTHROW
{ return msg; }
};
diff --git a/boost/spirit/home/support/utree/utree_traits.hpp b/boost/spirit/home/support/utree/utree_traits.hpp
index 4f9f46f026..0e084780be 100644
--- a/boost/spirit/home/support/utree/utree_traits.hpp
+++ b/boost/spirit/home/support/utree/utree_traits.hpp
@@ -1149,26 +1149,26 @@ namespace boost { namespace spirit { namespace traits
template <>
struct extract_from_container<utree, utf8_symbol_type>
{
- typedef std::string type;
+ typedef utf8_symbol_type type;
template <typename Context>
static type call(utree const& t, Context&)
{
utf8_symbol_range_type r = detail::get_or_deref<utf8_symbol_range_type>(t);
- return std::string(traits::begin(r), traits::end(r));
+ return type(traits::begin(r), traits::end(r));
}
};
template <>
struct extract_from_container<utree, utf8_string_type>
{
- typedef std::string type;
+ typedef utf8_string_type type;
template <typename Context>
static type call(utree const& t, Context&)
{
utf8_string_range_type r = detail::get_or_deref<utf8_string_range_type>(t);
- return std::string(traits::begin(r), traits::end(r));
+ return type(traits::begin(r), traits::end(r));
}
};
@@ -1264,24 +1264,24 @@ namespace boost { namespace spirit { namespace traits
template <>
struct transform_attribute<utree const, utf8_string_type, karma::domain>
{
- typedef std::string type;
+ typedef utf8_string_type type;
static type pre(utree const& t)
{
utf8_string_range_type r = detail::get_or_deref<utf8_string_range_type>(t);
- return std::string(traits::begin(r), traits::end(r));
+ return type(traits::begin(r), traits::end(r));
}
};
template <>
struct transform_attribute<utree const, utf8_symbol_type, karma::domain>
{
- typedef std::string type;
+ typedef utf8_symbol_type type;
static type pre(utree const& t)
{
utf8_symbol_range_type r = detail::get_or_deref<utf8_symbol_range_type>(t);
- return std::string(traits::begin(r), traits::end(r));
+ return type(traits::begin(r), traits::end(r));
}
};
diff --git a/boost/spirit/home/x3/binary/binary.hpp b/boost/spirit/home/x3/binary/binary.hpp
index bdf9c5e41e..4c187f4200 100644
--- a/boost/spirit/home/x3/binary/binary.hpp
+++ b/boost/spirit/home/x3/binary/binary.hpp
@@ -15,7 +15,6 @@
#include <boost/endian/conversion.hpp>
#include <boost/endian/arithmetic.hpp>
-#include <boost/fusion/include/at.hpp>
#include <boost/mpl/or.hpp>
#include <boost/type_traits/is_integral.hpp>
#include <boost/type_traits/is_enum.hpp>
diff --git a/boost/spirit/home/x3/core/action.hpp b/boost/spirit/home/x3/core/action.hpp
index 3bd33f57ff..3feab05f52 100644
--- a/boost/spirit/home/x3/core/action.hpp
+++ b/boost/spirit/home/x3/core/action.hpp
@@ -9,7 +9,6 @@
#include <boost/spirit/home/x3/support/context.hpp>
#include <boost/spirit/home/x3/support/traits/attribute_of.hpp>
-#include <boost/spirit/home/x3/support/traits/make_attribute.hpp>
#include <boost/spirit/home/x3/core/call.hpp>
#include <boost/spirit/home/x3/nonterminal/detail/transform_attribute.hpp>
#include <boost/range/iterator_range.hpp>
@@ -82,14 +81,9 @@ namespace boost { namespace spirit { namespace x3
typedef typename
traits::attribute_of<action<Subject, Action>, Context>::type
attribute_type;
- typedef traits::make_attribute<attribute_type, unused_type> make_attribute;
- typedef traits::transform_attribute<
- typename make_attribute::type, attribute_type, parser_id>
- transform;
// synthesize the attribute since one is not supplied
- typename make_attribute::type made_attr = make_attribute::call(unused_type());
- typename transform::type attr = transform::pre(made_attr);
+ attribute_type attr{};
return parse_main(first, last, context, rcontext, attr);
}
diff --git a/boost/spirit/home/x3/core/detail/parse_into_container.hpp b/boost/spirit/home/x3/core/detail/parse_into_container.hpp
index 4f2310a8e5..979238cff3 100644
--- a/boost/spirit/home/x3/core/detail/parse_into_container.hpp
+++ b/boost/spirit/home/x3/core/detail/parse_into_container.hpp
@@ -21,6 +21,7 @@
#include <boost/fusion/include/front.hpp>
#include <boost/fusion/include/back.hpp>
#include <boost/variant/apply_visitor.hpp>
+#include <iterator> // for std::make_move_iterator
namespace boost { namespace spirit { namespace x3 { namespace detail
{
@@ -99,7 +100,7 @@ namespace boost { namespace spirit { namespace x3 { namespace detail
return false;
// push the parsed value into our attribute
- traits::push_back(attr, val);
+ traits::push_back(attr, static_cast<value_type&&>(val));
return true;
}
@@ -262,7 +263,8 @@ namespace boost { namespace spirit { namespace x3 { namespace detail
Attribute rest;
bool r = parser.parse(first, last, context, rcontext, rest);
if (r)
- traits::append(attr, rest.begin(), rest.end());
+ traits::append(attr, std::make_move_iterator(rest.begin()),
+ std::make_move_iterator(rest.end()));
return r;
}
diff --git a/boost/spirit/home/x3/directive/expect.hpp b/boost/spirit/home/x3/directive/expect.hpp
index c57e4eb604..36faf8aa15 100644
--- a/boost/spirit/home/x3/directive/expect.hpp
+++ b/boost/spirit/home/x3/directive/expect.hpp
@@ -26,7 +26,7 @@ namespace boost { namespace spirit { namespace x3
: std::runtime_error("boost::spirit::x3::expectation_failure")
, where_(where), which_(which)
{}
- ~expectation_failure() throw() {}
+ ~expectation_failure() {}
std::string which() const { return which_; }
Iterator const& where() const { return where_; }
diff --git a/boost/spirit/home/x3/nonterminal/detail/rule.hpp b/boost/spirit/home/x3/nonterminal/detail/rule.hpp
index dda44e1f50..68ff056cf6 100644
--- a/boost/spirit/home/x3/nonterminal/detail/rule.hpp
+++ b/boost/spirit/home/x3/nonterminal/detail/rule.hpp
@@ -12,7 +12,6 @@
#include <boost/spirit/home/x3/core/parser.hpp>
#include <boost/spirit/home/x3/core/skip_over.hpp>
#include <boost/spirit/home/x3/directive/expect.hpp>
-#include <boost/spirit/home/x3/support/traits/make_attribute.hpp>
#include <boost/spirit/home/x3/support/utility/sfinae.hpp>
#include <boost/spirit/home/x3/nonterminal/detail/transform_attribute.hpp>
#include <boost/utility/addressof.hpp>
@@ -303,18 +302,14 @@ namespace boost { namespace spirit { namespace x3 { namespace detail
{
boost::ignore_unused(rule_name);
- typedef traits::make_attribute<Attribute, ActualAttribute> make_attribute;
-
// do down-stream transformation, provides attribute for
// rhs parser
typedef traits::transform_attribute<
- typename make_attribute::type, Attribute, parser_id>
+ ActualAttribute, Attribute, parser_id>
transform;
- typedef typename make_attribute::value_type value_type;
typedef typename transform::type transform_attr;
- value_type made_attr = make_attribute::call(attr);
- transform_attr attr_ = transform::pre(made_attr);
+ transform_attr attr_ = transform::pre(attr);
bool ok_parse
//Creates a place to hold the result of parse_rhs
@@ -325,7 +320,7 @@ namespace boost { namespace spirit { namespace x3 { namespace detail
// the #if...#endif) to call it's DTOR before any
// modifications are made to the attribute, attr_ passed
// to parse_rhs (such as might be done in
- // traits::post_transform when, for example,
+ // transform::post when, for example,
// ActualAttribute is a recursive variant).
#if defined(BOOST_SPIRIT_X3_DEBUG)
context_debug<Iterator, transform_attr>
@@ -343,7 +338,7 @@ namespace boost { namespace spirit { namespace x3 { namespace detail
{
// do up-stream transformation, this integrates the results
// back into the original attribute value, if appropriate
- traits::post_transform(attr, std::forward<transform_attr>(attr_));
+ transform::post(attr, std::forward<transform_attr>(attr_));
}
return ok_parse;
}
diff --git a/boost/spirit/home/x3/nonterminal/detail/transform_attribute.hpp b/boost/spirit/home/x3/nonterminal/detail/transform_attribute.hpp
index 88ba3ea5bb..42f616e15e 100644
--- a/boost/spirit/home/x3/nonterminal/detail/transform_attribute.hpp
+++ b/boost/spirit/home/x3/nonterminal/detail/transform_attribute.hpp
@@ -10,6 +10,7 @@
#include <boost/spirit/home/x3/support/traits/transform_attribute.hpp>
#include <boost/spirit/home/x3/support/traits/move_to.hpp>
+#include <type_traits>
#include <utility>
///////////////////////////////////////////////////////////////////////////////
@@ -44,15 +45,6 @@ namespace boost { namespace spirit { namespace x3
struct transform_attribute
: default_transform_attribute<Exposed, Transformed> {};
- // reference types need special handling
- template <typename Attribute>
- struct transform_attribute<Attribute&, Attribute>
- {
- typedef Attribute& type;
- static Attribute& pre(Attribute& val) { return val; }
- static void post(Attribute&, Attribute const&) {}
- };
-
// unused_type needs some special handling as well
template <>
struct transform_attribute<unused_type, unused_type>
@@ -88,23 +80,13 @@ namespace boost { namespace spirit { namespace x3 { namespace traits
{
template <typename Exposed, typename Transformed>
struct transform_attribute<Exposed, Transformed, x3::parser_id>
- : x3::transform_attribute<Exposed, Transformed> {};
-
- template <typename Exposed, typename Transformed>
- struct transform_attribute<Exposed&, Transformed, x3::parser_id>
- : transform_attribute<Exposed, Transformed, x3::parser_id> {};
-
- template <typename Attribute>
- struct transform_attribute<Attribute&, Attribute, x3::parser_id>
- : x3::transform_attribute<Attribute&, Attribute> {};
-
- ///////////////////////////////////////////////////////////////////////////
- template <typename Exposed, typename Transformed>
- void post_transform(Exposed& dest, Transformed&& attr)
+ : x3::transform_attribute<Exposed, Transformed>
{
- return transform_attribute<Exposed, Transformed, x3::parser_id>
- ::post(dest, std::forward<Transformed>(attr));
- }
+ static_assert(!std::is_reference<Exposed>::value,
+ "Exposed cannot be a reference type");
+ static_assert(!std::is_reference<Transformed>::value,
+ "Transformed cannot be a reference type");
+ };
}}}}
#endif
diff --git a/boost/spirit/home/x3/nonterminal/rule.hpp b/boost/spirit/home/x3/nonterminal/rule.hpp
index 10734deb7f..2aee90f551 100644
--- a/boost/spirit/home/x3/nonterminal/rule.hpp
+++ b/boost/spirit/home/x3/nonterminal/rule.hpp
@@ -13,6 +13,7 @@
#include <boost/preprocessor/variadic/to_seq.hpp>
#include <boost/preprocessor/variadic/elem.hpp>
#include <boost/preprocessor/seq/for_each.hpp>
+#include <type_traits>
#if !defined(BOOST_SPIRIT_X3_NO_RTTI)
#include <typeinfo>
@@ -75,7 +76,7 @@ namespace boost { namespace spirit { namespace x3
typedef ID id;
typedef Attribute attribute_type;
static bool const has_attribute =
- !is_same<Attribute, unused_type>::value;
+ !std::is_same<std::remove_const_t<Attribute>, unused_type>::value;
static bool const handles_container =
traits::is_container<Attribute>::value;
static bool const force_attribute = force_attribute_;
@@ -110,7 +111,32 @@ namespace boost { namespace spirit { namespace x3
bool parse(Iterator& first, Iterator const& last
, Context const& context, unused_type, Attribute_& attr) const
{
- return parse_rule(*this, first, last, context, attr);
+ static_assert(has_attribute,
+ "The rule does not have an attribute. Check your parser.");
+
+ using transform = traits::transform_attribute<
+ Attribute_, attribute_type, parser_id>;
+
+ using transform_attr = typename transform::type;
+ transform_attr attr_ = transform::pre(attr);
+
+ if (parse_rule(*this, first, last, context, attr_)) {
+ transform::post(attr, std::forward<transform_attr>(attr_));
+ return true;
+ }
+ return false;
+ }
+
+ template <typename Iterator, typename Context>
+ bool parse(Iterator& first, Iterator const& last
+ , Context const& context, unused_type, unused_type) const
+ {
+ static_assert(!has_attribute,
+ "The rule requires an input attribute. Check your parser.");
+
+ // make sure we pass exactly the rule attribute type
+ attribute_type no_attr;
+ return parse_rule(*this, first, last, context, no_attr);
}
char const* name;
@@ -140,11 +166,11 @@ namespace boost { namespace spirit { namespace x3
};
#define BOOST_SPIRIT_DECLARE_(r, data, rule_type) \
- template <typename Iterator, typename Context, typename Attribute> \
+ template <typename Iterator, typename Context> \
bool parse_rule( \
rule_type rule_ \
, Iterator& first, Iterator const& last \
- , Context const& context, Attribute& attr); \
+ , Context const& context, rule_type::attribute_type& attr); \
/***/
#define BOOST_SPIRIT_DECLARE(...) BOOST_PP_SEQ_FOR_EACH( \
@@ -154,11 +180,11 @@ namespace boost { namespace spirit { namespace x3
#if BOOST_WORKAROUND(BOOST_MSVC, < 1910)
#define BOOST_SPIRIT_DEFINE_(r, data, rule_name) \
using BOOST_PP_CAT(rule_name, _synonym) = decltype(rule_name); \
- template <typename Iterator, typename Context, typename Attribute> \
+ template <typename Iterator, typename Context> \
inline bool parse_rule( \
BOOST_PP_CAT(rule_name, _synonym) /* rule_ */ \
, Iterator& first, Iterator const& last \
- , Context const& context, Attribute& attr) \
+ , Context const& context, BOOST_PP_CAT(rule_name, _synonym)::attribute_type& attr) \
{ \
using boost::spirit::x3::unused; \
static auto const def_ = (rule_name = BOOST_PP_CAT(rule_name, _def)); \
@@ -167,11 +193,11 @@ namespace boost { namespace spirit { namespace x3
/***/
#else
#define BOOST_SPIRIT_DEFINE_(r, data, rule_name) \
- template <typename Iterator, typename Context, typename Attribute> \
+ template <typename Iterator, typename Context> \
inline bool parse_rule( \
decltype(rule_name) /* rule_ */ \
, Iterator& first, Iterator const& last \
- , Context const& context, Attribute& attr) \
+ , Context const& context, decltype(rule_name)::attribute_type& attr) \
{ \
using boost::spirit::x3::unused; \
static auto const def_ = (rule_name = BOOST_PP_CAT(rule_name, _def)); \
@@ -185,10 +211,10 @@ namespace boost { namespace spirit { namespace x3
/***/
#define BOOST_SPIRIT_INSTANTIATE(rule_type, Iterator, Context) \
- template bool parse_rule<Iterator, Context, rule_type::attribute_type>( \
+ template bool parse_rule<Iterator, Context>( \
rule_type rule_ \
, Iterator& first, Iterator const& last \
- , Context const& context, rule_type::attribute_type& attr); \
+ , Context const& context, rule_type::attribute_type&); \
/***/
diff --git a/boost/spirit/home/x3/nonterminal/simple_trace.hpp b/boost/spirit/home/x3/nonterminal/simple_trace.hpp
index 2b7969a71f..8a4851a393 100644
--- a/boost/spirit/home/x3/nonterminal/simple_trace.hpp
+++ b/boost/spirit/home/x3/nonterminal/simple_trace.hpp
@@ -12,7 +12,6 @@
#include <boost/spirit/home/x3/support/traits/print_token.hpp>
#include <boost/spirit/home/x3/support/traits/print_attribute.hpp>
#include <boost/spirit/home/x3/nonterminal/debug_handler_state.hpp>
-#include <boost/fusion/include/out.hpp>
#include <boost/type_traits/is_same.hpp>
#include <iostream>
@@ -102,11 +101,6 @@ namespace boost { namespace spirit { namespace x3
<< "</attributes>";
out << std::endl;
}
- //~ if (!fusion::empty(context.locals))
- //~ out
- //~ << "<locals>"
- //~ << context.locals
- //~ << "</locals>";
print_indent(--indent);
out
<< "</" << rule_name << '>'
diff --git a/boost/spirit/home/x3/numeric/real_policies.hpp b/boost/spirit/home/x3/numeric/real_policies.hpp
index 193ed84d39..fdd382d4fc 100644
--- a/boost/spirit/home/x3/numeric/real_policies.hpp
+++ b/boost/spirit/home/x3/numeric/real_policies.hpp
@@ -73,22 +73,9 @@ namespace boost { namespace spirit { namespace x3
}
///////////////////////////////////////////////////////////////////////
- // The parse_nan() and parse_inf() functions get called whenever:
- //
- // - a number to parse does not start with a digit (after having
- // successfully parsed an optional sign)
- //
- // or
- //
- // - after a floating point number of the value 1 (having no
- // exponential part and a fractional part value of 0) has been
- // parsed.
- //
- // The first call allows to recognize representations of NaN or Inf
- // starting with a non-digit character (such as NaN, Inf, QNaN etc.).
- //
- // The second call allows to recognize representation formats starting
- // with a 1.0 (such as 1.0#NAN or 1.0#INF etc.).
+ // The parse_nan() and parse_inf() functions get called whenever
+ // a number to parse does not start with a digit (after having
+ // successfully parsed an optional sign).
//
// The functions should return true if a Nan or Inf has been found. In
// this case the attr should be set to the matched value (NaN or
diff --git a/boost/spirit/home/x3/operator/detail/sequence.hpp b/boost/spirit/home/x3/operator/detail/sequence.hpp
index cd071f8c90..9d3fe5c992 100644
--- a/boost/spirit/home/x3/operator/detail/sequence.hpp
+++ b/boost/spirit/home/x3/operator/detail/sequence.hpp
@@ -9,7 +9,6 @@
#include <boost/spirit/home/x3/support/traits/attribute_of.hpp>
#include <boost/spirit/home/x3/support/traits/attribute_category.hpp>
-#include <boost/spirit/home/x3/support/traits/make_attribute.hpp>
#include <boost/spirit/home/x3/support/traits/has_attribute.hpp>
#include <boost/spirit/home/x3/support/traits/is_substitute.hpp>
#include <boost/spirit/home/x3/support/traits/container_traits.hpp>
@@ -37,6 +36,8 @@
#include <boost/type_traits/add_reference.hpp>
#include <boost/type_traits/is_same.hpp>
+#include <iterator> // for std::make_move_iterator
+
namespace boost { namespace spirit { namespace x3
{
template <typename Left, typename Right>
@@ -106,20 +107,13 @@ namespace boost { namespace spirit { namespace x3 { namespace detail
}
};
- template <typename Parser, typename Attribute>
- struct pass_sequence_attribute_used :
+ template <typename Parser, typename Attribute, typename Enable = void>
+ struct pass_sequence_attribute :
mpl::if_<
traits::is_size_one_view<Attribute>
, pass_sequence_attribute_size_one_view<Attribute>
, pass_through_sequence_attribute<Attribute>>::type {};
- template <typename Parser, typename Attribute, typename Enable = void>
- struct pass_sequence_attribute :
- mpl::if_<
- fusion::result_of::empty<Attribute>
- , pass_sequence_attribute_unused
- , pass_sequence_attribute_used<Parser, Attribute>>::type {};
-
template <typename L, typename R, typename Attribute>
struct pass_sequence_attribute<sequence<L, R>, Attribute>
: pass_through_sequence_attribute<Attribute> {};
@@ -137,6 +131,10 @@ namespace boost { namespace spirit { namespace x3 { namespace detail
, typename Enable = void>
struct partition_attribute
{
+ using attr_category = typename traits::attribute_category<Attribute>::type;
+ static_assert(is_same<traits::tuple_attribute, attr_category>::value,
+ "The parser expects tuple-like attribute type");
+
static int const l_size = sequence_size<L, Context>::value;
static int const r_size = sequence_size<R, Context>::value;
@@ -300,11 +298,11 @@ namespace boost { namespace spirit { namespace x3 { namespace detail
};
template <typename Parser, typename Iterator, typename Context
- , typename RContext, typename Attribute>
+ , typename RContext, typename Attribute, typename AttributeCategory>
bool parse_sequence(
Parser const& parser, Iterator& first, Iterator const& last
, Context const& context, RContext& rcontext, Attribute& attr
- , traits::tuple_attribute)
+ , AttributeCategory)
{
typedef typename Parser::left_type Left;
typedef typename Parser::right_type Right;
@@ -325,78 +323,6 @@ namespace boost { namespace spirit { namespace x3 { namespace detail
return false;
}
- template <typename Parser, typename Iterator, typename Context
- , typename RContext, typename Attribute>
- bool parse_sequence_plain(
- Parser const& parser, Iterator& first, Iterator const& last
- , Context const& context, RContext& rcontext, Attribute& attr)
- {
- typedef typename Parser::left_type Left;
- typedef typename Parser::right_type Right;
- typedef typename traits::attribute_of<Left, Context>::type l_attr_type;
- typedef typename traits::attribute_of<Right, Context>::type r_attr_type;
- typedef traits::make_attribute<l_attr_type, Attribute> l_make_attribute;
- typedef traits::make_attribute<r_attr_type, Attribute> r_make_attribute;
-
- typename l_make_attribute::type l_attr = l_make_attribute::call(attr);
- typename r_make_attribute::type r_attr = r_make_attribute::call(attr);
-
- Iterator save = first;
- if (parser.left.parse(first, last, context, rcontext, l_attr)
- && parser.right.parse(first, last, context, rcontext, r_attr))
- return true;
- first = save;
- return false;
- }
-
- template <typename Parser, typename Iterator, typename Context
- , typename RContext, typename Attribute>
- bool parse_sequence(
- Parser const& parser, Iterator& first, Iterator const& last
- , Context const& context, RContext& rcontext, Attribute& attr
- , traits::plain_attribute)
- {
- return parse_sequence_plain(parser, first, last, context, rcontext, attr);
- }
-
- template <typename Parser, typename Iterator, typename Context
- , typename RContext, typename Attribute>
- bool parse_sequence(
- Parser const& parser, Iterator& first, Iterator const& last
- , Context const& context, RContext& rcontext, Attribute& attr
- , traits::variant_attribute)
- {
- return parse_sequence_plain(parser, first, last, context, rcontext, attr);
- }
-
- template <typename Parser, typename Iterator, typename Context
- , typename RContext, typename Attribute>
- bool parse_sequence(
- Parser const& parser, Iterator& first, Iterator const& last
- , Context const& context, RContext& rcontext, Attribute& attr
- , traits::optional_attribute)
- {
- return parse_sequence_plain(parser, first, last, context, rcontext, attr);
- }
-
- template <typename Parser, typename Iterator, typename Context
- , typename RContext, typename Attribute>
- bool parse_sequence(
- Parser const& parser, Iterator& first, Iterator const& last
- , Context const& context, RContext& rcontext, Attribute& attr
- , traits::range_attribute)
- {
- return parse_sequence_plain(parser, first, last, context, rcontext, attr);
- }
-
- template <typename Left, typename Right, typename Iterator
- , typename Context, typename RContext, typename Attribute>
- bool parse_sequence(
- Left const& left, Right const& right
- , Iterator& first, Iterator const& last
- , Context const& context, RContext& rcontext, Attribute& attr
- , traits::container_attribute);
-
template <typename Parser, typename Context>
constexpr bool pass_sequence_container_attribute
= sequence_size<Parser, Context>::value > 1;
@@ -521,7 +447,8 @@ namespace boost { namespace spirit { namespace x3 { namespace detail
{
return false;
}
- traits::append(attr, traits::begin(attr_), traits::end(attr_));
+ traits::append(attr, std::make_move_iterator(traits::begin(attr_)),
+ std::make_move_iterator(traits::end(attr_)));
return true;
}
diff --git a/boost/spirit/home/x3/operator/optional.hpp b/boost/spirit/home/x3/operator/optional.hpp
index 70beefef21..19551557b5 100644
--- a/boost/spirit/home/x3/operator/optional.hpp
+++ b/boost/spirit/home/x3/operator/optional.hpp
@@ -52,7 +52,7 @@ namespace boost { namespace spirit { namespace x3
value_type;
// create a local value
- value_type val = value_type();
+ value_type val{};
if (this->subject.parse(first, last, context, rcontext, val))
{
diff --git a/boost/spirit/home/x3/string/detail/tst.hpp b/boost/spirit/home/x3/string/detail/tst.hpp
index 50f6df6a95..16c83e56fc 100644
--- a/boost/spirit/home/x3/string/detail/tst.hpp
+++ b/boost/spirit/home/x3/string/detail/tst.hpp
@@ -8,7 +8,6 @@
#define BOOST_SPIRIT_X3_TST_MARCH_09_2007_0905AM
#include <boost/call_traits.hpp>
-#include <boost/detail/iterator.hpp>
#include <boost/assert.hpp>
namespace boost { namespace spirit { namespace x3 { namespace detail
@@ -111,9 +110,7 @@ namespace boost { namespace spirit { namespace x3 { namespace detail
tst_node** pp = &start;
for (;;)
{
- typename
- boost::detail::iterator_traits<Iterator>::value_type
- c = *first;
+ auto c = *first;
if (*pp == 0)
*pp = alloc->new_node(c);
@@ -147,9 +144,7 @@ namespace boost { namespace spirit { namespace x3 { namespace detail
if (p == 0 || first == last)
return;
- typename
- boost::detail::iterator_traits<Iterator>::value_type
- c = *first;
+ auto c = *first;
if (c == p->id)
{
diff --git a/boost/spirit/home/x3/string/symbols.hpp b/boost/spirit/home/x3/string/symbols.hpp
index f9ba4cd392..3d2cbf9f9f 100644
--- a/boost/spirit/home/x3/string/symbols.hpp
+++ b/boost/spirit/home/x3/string/symbols.hpp
@@ -21,13 +21,10 @@
#include <boost/spirit/home/support/char_encoding/standard.hpp>
#include <boost/spirit/home/support/char_encoding/standard_wide.hpp>
-#include <boost/fusion/include/at.hpp>
-#include <boost/range.hpp>
-#include <boost/type_traits/add_reference.hpp>
-#include <boost/type_traits/is_same.hpp>
-#include <boost/shared_ptr.hpp>
-
#include <initializer_list>
+#include <iterator> // std::begin
+#include <memory> // std::shared_ptr
+#include <type_traits>
#if defined(BOOST_MSVC)
# pragma warning(push)
@@ -48,21 +45,21 @@ namespace boost { namespace spirit { namespace x3
typedef value_type attribute_type;
static bool const has_attribute =
- !is_same<unused_type, attribute_type>::value;
+ !std::is_same<unused_type, attribute_type>::value;
static bool const handles_container =
traits::is_container<attribute_type>::value;
symbols_parser(std::string const& name = "symbols")
- : add(*this)
- , remove(*this)
- , lookup(new Lookup())
+ : add{*this}
+ , remove{*this}
+ , lookup(std::make_shared<Lookup>())
, name_(name)
{
}
symbols_parser(symbols_parser const& syms)
- : add(*this)
- , remove(*this)
+ : add{*this}
+ , remove{*this}
, lookup(syms.lookup)
, name_(syms.name_)
{
@@ -70,54 +67,37 @@ namespace boost { namespace spirit { namespace x3
template <typename Symbols>
symbols_parser(Symbols const& syms, std::string const& name = "symbols")
- : add(*this)
- , remove(*this)
- , lookup(new Lookup())
- , name_(name)
+ : symbols_parser(name)
{
- typename range_const_iterator<Symbols>::type si = boost::begin(syms);
- while (si != boost::end(syms))
- add(*si++);
+ for (auto& sym : syms)
+ add(sym);
}
template <typename Symbols, typename Data>
symbols_parser(Symbols const& syms, Data const& data
, std::string const& name = "symbols")
- : add(*this)
- , remove(*this)
- , lookup(new Lookup())
- , name_(name)
+ : symbols_parser(name)
{
- typename range_const_iterator<Symbols>::type si = boost::begin(syms);
- typename range_const_iterator<Data>::type di = boost::begin(data);
- while (si != boost::end(syms))
- add(*si++, *di++);
+ using std::begin;
+ auto di = begin(data);
+ for (auto& sym : syms)
+ add(sym, *di++);
}
symbols_parser(std::initializer_list<std::pair<char_type const*, T>> syms
, std::string const & name="symbols")
- : add(*this)
- , remove(*this)
- , lookup(new Lookup())
- , name_(name)
+ : symbols_parser(name)
{
- typedef std::initializer_list<std::pair<char_type const*, T>> symbols_t;
- typename range_const_iterator<symbols_t>::type si = boost::begin(syms);
- for (;si != boost::end(syms); ++si)
- add(si->first, si->second);
+ for (auto& sym : syms)
+ add(sym.first, sym.second);
}
symbols_parser(std::initializer_list<char_type const*> syms
, std::string const &name="symbols")
- : add(*this)
- , remove(*this)
- , lookup(new Lookup())
- , name_(name)
+ : symbols_parser(name)
{
- typedef std::initializer_list<char_type const*> symbols_t;
- typename range_const_iterator<symbols_t>::type si = boost::begin(syms);
- while (si != boost::end(syms))
- add(*si++);
+ for (auto str : syms)
+ add(str);
}
symbols_parser&
@@ -241,14 +221,6 @@ namespace boost { namespace spirit { namespace x3
struct adder
{
- template <typename, typename = unused_type, typename = unused_type>
- struct result { typedef adder const& type; };
-
- adder(symbols_parser& sym)
- : sym(sym)
- {
- }
-
template <typename Iterator>
adder const&
operator()(Iterator first, Iterator last, T const& val) const
@@ -280,14 +252,6 @@ namespace boost { namespace spirit { namespace x3
struct remover
{
- template <typename, typename = unused_type, typename = unused_type>
- struct result { typedef remover const& type; };
-
- remover(symbols_parser& sym)
- : sym(sym)
- {
- }
-
template <typename Iterator>
remover const&
operator()(Iterator const& first, Iterator const& last) const
@@ -319,7 +283,7 @@ namespace boost { namespace spirit { namespace x3
adder add;
remover remove;
- shared_ptr<Lookup> lookup;
+ std::shared_ptr<Lookup> lookup;
std::string name_;
};
diff --git a/boost/spirit/home/x3/support/ast/position_tagged.hpp b/boost/spirit/home/x3/support/ast/position_tagged.hpp
index a605b07f7c..3a804840f7 100644
--- a/boost/spirit/home/x3/support/ast/position_tagged.hpp
+++ b/boost/spirit/home/x3/support/ast/position_tagged.hpp
@@ -51,7 +51,7 @@ namespace boost { namespace spirit { namespace x3
(!is_base_of<position_tagged, AST>::value)
, boost::iterator_range<iterator_type>
>::type
- position_of(AST const& ast) const
+ position_of(AST const& /* ast */) const
{
// returns an empty position
return boost::iterator_range<iterator_type>();
@@ -59,7 +59,7 @@ namespace boost { namespace spirit { namespace x3
// This will catch all nodes except those inheriting from position_tagged
template <typename AST>
- void annotate(AST& ast, iterator_type first, iterator_type last, mpl::false_)
+ void annotate(AST& /* ast */, iterator_type /* first */, iterator_type /* last */, mpl::false_)
{
// (no-op) no need for tags
}
diff --git a/boost/spirit/home/x3/support/ast/variant.hpp b/boost/spirit/home/x3/support/ast/variant.hpp
index e33767b549..f904e26ecc 100644
--- a/boost/spirit/home/x3/support/ast/variant.hpp
+++ b/boost/spirit/home/x3/support/ast/variant.hpp
@@ -118,6 +118,10 @@ namespace boost { namespace spirit { namespace x3
{};
}
+#if defined(BOOST_MSVC)
+# pragma warning(push)
+# pragma warning(disable: 4521) // multiple copy constructors specified
+#endif
template <typename ...Types>
struct variant
{
@@ -222,6 +226,9 @@ namespace boost { namespace spirit { namespace x3
variant_type var;
};
+#if defined(BOOST_MSVC)
+# pragma warning(pop)
+#endif
}}}
namespace boost
diff --git a/boost/spirit/home/x3/support/numeric_utils/detail/extract_int.hpp b/boost/spirit/home/x3/support/numeric_utils/detail/extract_int.hpp
index 2115903e6c..86b588920b 100644
--- a/boost/spirit/home/x3/support/numeric_utils/detail/extract_int.hpp
+++ b/boost/spirit/home/x3/support/numeric_utils/detail/extract_int.hpp
@@ -23,7 +23,6 @@
#include <boost/preprocessor/control/if.hpp>
#include <boost/preprocessor/seq/elem.hpp>
-#include <boost/detail/iterator.hpp>
#include <boost/utility/enable_if.hpp>
#include <boost/type_traits/is_integral.hpp>
@@ -34,6 +33,8 @@
#include <boost/mpl/and.hpp>
#include <boost/limits.hpp>
+#include <iterator> // for std::iterator_traits
+
#if !defined(SPIRIT_NUMERICS_LOOP_UNROLL)
# define SPIRIT_NUMERICS_LOOP_UNROLL 3
#endif
@@ -52,6 +53,9 @@ namespace boost { namespace spirit { namespace x3 { namespace detail
template <typename T, unsigned Radix>
struct digits_traits;
+ template <int Digits, unsigned Radix>
+ struct digits2_to_n;
+
// lookup table for log2(x) : 2 <= x <= 36
#define BOOST_SPIRIT_X3_LOG2 (#error)(#error) \
(1000000)(1584960)(2000000)(2321920)(2584960)(2807350) \
@@ -63,11 +67,10 @@ namespace boost { namespace spirit { namespace x3 { namespace detail
/***/
#define BOOST_PP_LOCAL_MACRO(Radix) \
- template <typename T> struct digits_traits<T, Radix> \
+ template <int Digits> struct digits2_to_n<Digits, Radix> \
{ \
- typedef std::numeric_limits<T> numeric_limits_type; \
BOOST_STATIC_CONSTANT(int, value = static_cast<int>( \
- (numeric_limits_type::digits * 1000000) / \
+ (Digits * 1000000) / \
BOOST_PP_SEQ_ELEM(Radix, BOOST_SPIRIT_X3_LOG2))); \
}; \
/***/
@@ -77,6 +80,18 @@ namespace boost { namespace spirit { namespace x3 { namespace detail
#undef BOOST_SPIRIT_X3_LOG2
+ template <typename T, unsigned Radix>
+ struct digits_traits : digits2_to_n<std::numeric_limits<T>::digits, Radix>
+ {
+ static_assert(std::numeric_limits<T>::radix == 2, "");
+ };
+
+ template <typename T>
+ struct digits_traits<T, 10>
+ {
+ static int constexpr value = std::numeric_limits<T>::digits10;
+ };
+
///////////////////////////////////////////////////////////////////////////
//
// Traits class for radix specific number conversion
@@ -132,19 +147,19 @@ namespace boost { namespace spirit { namespace x3 { namespace detail
inline static bool add(T& n, Char ch, mpl::true_) // checked add
{
// Ensure n *= Radix will not overflow
- static T const max = (std::numeric_limits<T>::max)();
- static T const val = max / Radix;
+ T const max = (std::numeric_limits<T>::max)();
+ T const val = max / Radix;
if (n > val)
return false;
- n *= Radix;
+ T tmp = n * Radix;
// Ensure n += digit will not overflow
const int digit = radix_traits<Radix>::digit(ch);
- if (n > max - digit)
+ if (tmp > max - digit)
return false;
- n += static_cast<T>(digit);
+ n = tmp + static_cast<T>(digit);
return true;
}
};
@@ -163,19 +178,19 @@ namespace boost { namespace spirit { namespace x3 { namespace detail
inline static bool add(T& n, Char ch, mpl::true_) // checked subtract
{
// Ensure n *= Radix will not underflow
- static T const min = (std::numeric_limits<T>::min)();
- static T const val = (min + 1) / T(Radix);
+ T const min = (std::numeric_limits<T>::min)();
+ T const val = min / T(Radix);
if (n < val)
return false;
- n *= Radix;
+ T tmp = n * Radix;
// Ensure n -= digit will not underflow
int const digit = radix_traits<Radix>::digit(ch);
- if (n < min + digit)
+ if (tmp < min + digit)
return false;
- n -= static_cast<T>(digit);
+ n = tmp - static_cast<T>(digit);
return true;
}
};
@@ -190,7 +205,7 @@ namespace boost { namespace spirit { namespace x3 { namespace detail
inline static bool
call(Char ch, std::size_t count, T& n, mpl::true_)
{
- static std::size_t const
+ std::size_t constexpr
overflow_free = digits_traits<T, Radix>::value - 1;
if (count < overflow_free)
@@ -296,7 +311,7 @@ namespace boost { namespace spirit { namespace x3 { namespace detail
typedef radix_traits<Radix> radix_check;
typedef int_extractor<Radix, Accumulator, MaxDigits> extractor;
typedef typename
- boost::detail::iterator_traits<Iterator>::value_type
+ std::iterator_traits<Iterator>::value_type
char_type;
Iterator it = first;
@@ -394,7 +409,7 @@ namespace boost { namespace spirit { namespace x3 { namespace detail
typedef radix_traits<Radix> radix_check;
typedef int_extractor<Radix, Accumulator, -1> extractor;
typedef typename
- boost::detail::iterator_traits<Iterator>::value_type
+ std::iterator_traits<Iterator>::value_type
char_type;
Iterator it = first;
diff --git a/boost/spirit/home/x3/support/numeric_utils/extract_real.hpp b/boost/spirit/home/x3/support/numeric_utils/extract_real.hpp
index 9749fbec1f..fb5cd4d069 100644
--- a/boost/spirit/home/x3/support/numeric_utils/extract_real.hpp
+++ b/boost/spirit/home/x3/support/numeric_utils/extract_real.hpp
@@ -103,20 +103,6 @@ namespace boost { namespace spirit { namespace x3 { namespace extension
// no-op for unused_type
return n;
}
-
- template <typename T>
- inline bool
- is_equal_to_one(T const& value)
- {
- return value == 1.0;
- }
-
- inline bool
- is_equal_to_one(unused_type)
- {
- // no-op for unused_type
- return false;
- }
}}}}
namespace boost { namespace spirit { namespace x3
@@ -236,20 +222,6 @@ namespace boost { namespace spirit { namespace x3
// No exponent found. Scale the number by -frac_digits.
extension::scale(-frac_digits, n);
}
- else if (extension::is_equal_to_one(n))
- {
- // There is a chance of having to parse one of the 1.0#...
- // styles some implementations use for representing NaN or Inf.
-
- // Check whether the number to parse is a NaN or Inf
- if (p.parse_nan(first, last, n) ||
- p.parse_inf(first, last, n))
- {
- // If we got a negative sign, negate the number
- traits::move_to(extension::negate(neg, n), attr);
- return true; // got a NaN or Inf, return immediately
- }
- }
// If we got a negative sign, negate the number
traits::move_to(extension::negate(neg, n), attr);
diff --git a/boost/spirit/home/x3/support/subcontext.hpp b/boost/spirit/home/x3/support/subcontext.hpp
index d4c60d084b..db8e7a9f78 100644
--- a/boost/spirit/home/x3/support/subcontext.hpp
+++ b/boost/spirit/home/x3/support/subcontext.hpp
@@ -9,7 +9,6 @@
#if !defined(BOOST_SPIRIT_X3_SUBCONTEXT_APR_15_2013_0840AM)
#define BOOST_SPIRIT_X3_SUBCONTEXT_APR_15_2013_0840AM
-#include <boost/fusion/support/pair.hpp>
#include <boost/spirit/home/x3/support/context.hpp>
#include <boost/spirit/home/x3/support/unused.hpp>
diff --git a/boost/spirit/home/x3/support/traits/attribute_category.hpp b/boost/spirit/home/x3/support/traits/attribute_category.hpp
index fdca18fb71..62e61713ab 100644
--- a/boost/spirit/home/x3/support/traits/attribute_category.hpp
+++ b/boost/spirit/home/x3/support/traits/attribute_category.hpp
@@ -11,7 +11,6 @@
#include <boost/mpl/identity.hpp>
#include <boost/mpl/logical.hpp>
#include <boost/mpl/eval_if.hpp>
-#include <boost/fusion/include/copy.hpp>
#include <boost/fusion/include/is_sequence.hpp>
#include <boost/fusion/support/category_of.hpp>
#include <boost/spirit/home/x3/support/traits/is_variant.hpp>
diff --git a/boost/spirit/home/x3/support/traits/container_traits.hpp b/boost/spirit/home/x3/support/traits/container_traits.hpp
index f2d1086dd2..8e1310afe1 100644
--- a/boost/spirit/home/x3/support/traits/container_traits.hpp
+++ b/boost/spirit/home/x3/support/traits/container_traits.hpp
@@ -11,7 +11,6 @@
#include <boost/fusion/support/category_of.hpp>
#include <boost/spirit/home/x3/support/unused.hpp>
-#include <boost/detail/iterator.hpp>
#include <boost/fusion/include/deque.hpp>
#include <boost/tti/has_type.hpp>
#include <boost/mpl/identity.hpp>
@@ -123,7 +122,7 @@ namespace boost { namespace spirit { namespace x3 { namespace traits
template <typename T>
static bool call(Container& c, T&& val)
{
- c.insert(c.end(), std::move(val));
+ c.insert(c.end(), static_cast<T&&>(val));
return true;
}
};
@@ -131,7 +130,7 @@ namespace boost { namespace spirit { namespace x3 { namespace traits
template <typename Container, typename T>
inline bool push_back(Container& c, T&& val)
{
- return push_back_container<Container>::call(c, std::move(val));
+ return push_back_container<Container>::call(c, static_cast<T&&>(val));
}
template <typename Container>
@@ -277,7 +276,7 @@ namespace boost { namespace spirit { namespace x3 { namespace traits
template <typename Iterator, typename Enable = void>
struct deref_iterator
{
- typedef typename boost::detail::iterator_traits<Iterator>::reference type;
+ typedef typename std::iterator_traits<Iterator>::reference type;
static type call(Iterator& it)
{
return *it;
diff --git a/boost/spirit/home/x3/support/traits/make_attribute.hpp b/boost/spirit/home/x3/support/traits/make_attribute.hpp
deleted file mode 100644
index 9465228c1d..0000000000
--- a/boost/spirit/home/x3/support/traits/make_attribute.hpp
+++ /dev/null
@@ -1,82 +0,0 @@
-/*=============================================================================
- Copyright (c) 2001-2014 Joel de Guzman
- Copyright (c) 2001-2012 Hartmut Kaiser
- http://spirit.sourceforge.net/
-
- Distributed under the Boost Software License, Version 1.0. (See accompanying
- file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
-=============================================================================*/
-#if !defined(BOOST_SPIRIT_X3_MAKE_ATTRIBUTE_JAN_8_2012_0721PM)
-#define BOOST_SPIRIT_X3_MAKE_ATTRIBUTE_JAN_8_2012_0721PM
-
-#include <boost/mpl/if.hpp>
-#include <boost/type_traits/remove_const.hpp>
-#include <boost/type_traits/add_reference.hpp>
-#include <boost/spirit/home/x3/support/unused.hpp>
-
-namespace boost { namespace spirit { namespace x3 { namespace traits
-{
- template <typename Attribute>
- struct make_attribute_base
- {
- static Attribute call(unused_type)
- {
- // synthesize the attribute/parameter
- return Attribute();
- }
-
- template <typename T>
- static T& call(T& value)
- {
- return value; // just pass the one provided
- }
- };
-
- template <typename Attribute, typename ActualAttribute>
- struct make_attribute : make_attribute_base<Attribute>
- {
- typedef ActualAttribute& type;
- typedef ActualAttribute value_type;
- };
-
- template <typename Attribute>
- struct make_attribute<Attribute, unused_type>
- : make_attribute_base<Attribute>
- {
- typedef typename remove_const<Attribute>::type attribute_type;
- typedef attribute_type type;
- typedef attribute_type value_type;
- };
-
- template <typename Attribute, typename ActualAttribute>
- struct make_attribute<Attribute&, ActualAttribute>
- : make_attribute<Attribute, ActualAttribute> {};
-
- template <typename Attribute, typename ActualAttribute>
- struct make_attribute<Attribute const&, ActualAttribute>
- : make_attribute<Attribute const, ActualAttribute> {};
-
- template <typename ActualAttribute>
- struct make_attribute<unused_type, ActualAttribute>
- {
- typedef unused_type type;
- typedef unused_type value_type;
- static unused_type call(unused_type)
- {
- return unused;
- }
- };
-
- template <>
- struct make_attribute<unused_type, unused_type>
- {
- typedef unused_type type;
- typedef unused_type value_type;
- static unused_type call(unused_type)
- {
- return unused;
- }
- };
-}}}}
-
-#endif
diff --git a/boost/spirit/home/x3/support/traits/move_to.hpp b/boost/spirit/home/x3/support/traits/move_to.hpp
index 2275182f2c..5016d30deb 100644
--- a/boost/spirit/home/x3/support/traits/move_to.hpp
+++ b/boost/spirit/home/x3/support/traits/move_to.hpp
@@ -14,7 +14,6 @@
#include <boost/spirit/home/x3/support/traits/variant_has_substitute.hpp>
#include <boost/fusion/include/is_sequence.hpp>
#include <boost/fusion/include/front.hpp>
-#include <boost/fusion/include/size.hpp>
#include <boost/fusion/include/move.hpp>
#include <boost/fusion/include/is_sequence.hpp>
#include <utility>
diff --git a/boost/spirit/home/x3/support/traits/numeric_traits.hpp b/boost/spirit/home/x3/support/traits/numeric_traits.hpp
index 9f455cc627..cf4ca933cc 100644
--- a/boost/spirit/home/x3/support/traits/numeric_traits.hpp
+++ b/boost/spirit/home/x3/support/traits/numeric_traits.hpp
@@ -8,9 +8,8 @@
#define BOOST_SPIRIT_X3_NUMERIC_TRAITS_JAN_07_2011_0722AM
#include <boost/config.hpp>
-#include <boost/integer_traits.hpp>
#include <boost/mpl/bool.hpp>
-#include <boost/utility/enable_if.hpp>
+#include <limits>
namespace boost { namespace spirit { namespace x3 { namespace traits
{
@@ -112,13 +111,9 @@ namespace boost { namespace spirit { namespace x3 { namespace traits
template <typename T, typename Enable = void>
struct is_infinite;
-
+
template <typename T, typename Enable = void>
- struct check_overflow : mpl::false_ {};
-
- template <typename T>
- struct check_overflow<T, typename enable_if_c<integer_traits<T>::is_integral>::type>
- : mpl::true_ {};
+ struct check_overflow : mpl::bool_<std::numeric_limits<T>::is_bounded> {};
}}}}
#endif
diff --git a/boost/spirit/home/x3/support/traits/transform_attribute.hpp b/boost/spirit/home/x3/support/traits/transform_attribute.hpp
index 98af3099e6..9d92eeac49 100644
--- a/boost/spirit/home/x3/support/traits/transform_attribute.hpp
+++ b/boost/spirit/home/x3/support/traits/transform_attribute.hpp
@@ -24,21 +24,6 @@ namespace boost { namespace spirit { namespace x3 { namespace traits
template <typename Exposed, typename Transformed, typename Tag
, typename Enable = void>
struct transform_attribute;
-
- ///////////////////////////////////////////////////////////////////////////
- template <typename Tag, typename Transformed, typename Exposed>
- typename transform_attribute<Exposed, Transformed, Tag>::type
- pre_transform(Exposed& attr)
- {
- return transform_attribute<Exposed, Transformed, Tag>::pre(attr);
- }
-
- template <typename Tag, typename Transformed, typename Exposed>
- typename transform_attribute<Exposed, Transformed, Tag>::type
- pre_transform(Exposed const& attr)
- {
- return transform_attribute<Exposed const, Transformed, Tag>::pre(attr);
- }
}}}}
#endif
diff --git a/boost/spirit/home/x3/support/traits/value_traits.hpp b/boost/spirit/home/x3/support/traits/value_traits.hpp
index d28af74d3f..2610db015f 100644
--- a/boost/spirit/home/x3/support/traits/value_traits.hpp
+++ b/boost/spirit/home/x3/support/traits/value_traits.hpp
@@ -9,8 +9,6 @@
#if !defined(BOOST_SPIRIT_X3_VALUE_TRAITS_MAY_07_2013_0203PM)
#define BOOST_SPIRIT_X3_VALUE_TRAITS_MAY_07_2013_0203PM
-#include <boost/utility/value_init.hpp>
-
namespace boost { namespace spirit { namespace x3 { namespace traits
{
template <typename T, typename Enable = void>
@@ -18,7 +16,7 @@ namespace boost { namespace spirit { namespace x3 { namespace traits
{
static T call()
{
- return boost::value_initialized<T>();
+ return {};
}
};
}}}}
diff --git a/boost/spirit/home/x3/support/traits/variant_find_substitute.hpp b/boost/spirit/home/x3/support/traits/variant_find_substitute.hpp
index d258d54dc5..da18034481 100644
--- a/boost/spirit/home/x3/support/traits/variant_find_substitute.hpp
+++ b/boost/spirit/home/x3/support/traits/variant_find_substitute.hpp
@@ -9,6 +9,7 @@
#define BOOST_SPIRIT_X3_VARIANT_FIND_SUBSTITUTE_APR_18_2014_930AM
#include <boost/spirit/home/x3/support/traits/is_substitute.hpp>
+#include <boost/mpl/find.hpp>
namespace boost { namespace spirit { namespace x3 { namespace traits
{
@@ -22,9 +23,7 @@ namespace boost { namespace spirit { namespace x3 { namespace traits
typedef typename variant_type::types types;
typedef typename mpl::end<types>::type end;
- typedef typename
- mpl::find_if<types, is_same<mpl::_1, Attribute> >::type
- iter_1;
+ typedef typename mpl::find<types, Attribute>::type iter_1;
typedef typename
mpl::eval_if<
diff --git a/boost/spirit/home/x3/support/traits/variant_has_substitute.hpp b/boost/spirit/home/x3/support/traits/variant_has_substitute.hpp
index 2f8b42a834..9faece9bce 100644
--- a/boost/spirit/home/x3/support/traits/variant_has_substitute.hpp
+++ b/boost/spirit/home/x3/support/traits/variant_has_substitute.hpp
@@ -9,6 +9,7 @@
#define BOOST_SPIRIT_X3_VARIANT_HAS_SUBSTITUTE_APR_18_2014_925AM
#include <boost/spirit/home/x3/support/traits/is_substitute.hpp>
+#include <boost/mpl/find.hpp>
namespace boost { namespace spirit { namespace x3 { namespace traits
{
@@ -22,9 +23,7 @@ namespace boost { namespace spirit { namespace x3 { namespace traits
typedef typename variant_type::types types;
typedef typename mpl::end<types>::type end;
- typedef typename
- mpl::find_if<types, is_same<mpl::_1, Attribute>>::type
- iter_1;
+ typedef typename mpl::find<types, Attribute>::type iter_1;
typedef typename
mpl::eval_if<
diff --git a/boost/spirit/home/x3/support/unused.hpp b/boost/spirit/home/x3/support/unused.hpp
index f7857e0dbd..0486df3090 100644
--- a/boost/spirit/home/x3/support/unused.hpp
+++ b/boost/spirit/home/x3/support/unused.hpp
@@ -8,9 +8,7 @@
#if !defined(BOOST_SPIRIT_X3_UNUSED_APRIL_16_2006_0616PM)
#define BOOST_SPIRIT_X3_UNUSED_APRIL_16_2006_0616PM
-#include <ostream>
-#include <istream>
-#include <boost/mpl/identity.hpp>
+#include <iosfwd>
#if defined(BOOST_MSVC)
# pragma warning(push)
diff --git a/boost/spirit/home/x3/support/utility/testing.hpp b/boost/spirit/home/x3/support/utility/testing.hpp
index 6d38ccfed7..eb99f69204 100644
--- a/boost/spirit/home/x3/support/utility/testing.hpp
+++ b/boost/spirit/home/x3/support/utility/testing.hpp
@@ -230,7 +230,7 @@ namespace boost { namespace spirit { namespace x3 { namespace testing
std::string output = f(load(input_path), input_path);
std::string expected = load(expect_path);
- auto result = compare(output, expected);
+ auto result = compare(output, expected, re_prefix, re_suffix);
if (!result.full_match)
{
std::cout << "=============================================" << std::endl;
diff --git a/boost/spirit/home/x3/version.hpp b/boost/spirit/home/x3/version.hpp
index 2a3795870e..b91ff80043 100644
--- a/boost/spirit/home/x3/version.hpp
+++ b/boost/spirit/home/x3/version.hpp
@@ -14,6 +14,6 @@
// This is the version of the current Spirit X3 distribution
//
///////////////////////////////////////////////////////////////////////////////
-#define SPIRIT_X3_VERSION 0x3003
+#define SPIRIT_X3_VERSION 0x3004
#endif