summaryrefslogtreecommitdiff
path: root/boost/spirit/home/karma
diff options
context:
space:
mode:
Diffstat (limited to 'boost/spirit/home/karma')
-rw-r--r--boost/spirit/home/karma/auxiliary/attr_cast.hpp2
-rw-r--r--boost/spirit/home/karma/char/char.hpp2
-rw-r--r--boost/spirit/home/karma/detail/alternative_function.hpp2
-rw-r--r--boost/spirit/home/karma/detail/output_iterator.hpp2
-rw-r--r--boost/spirit/home/karma/numeric/detail/real_utils.hpp8
-rw-r--r--boost/spirit/home/karma/stream/ostream_iterator.hpp6
6 files changed, 15 insertions, 7 deletions
diff --git a/boost/spirit/home/karma/auxiliary/attr_cast.hpp b/boost/spirit/home/karma/auxiliary/attr_cast.hpp
index 2e67b6b391..9df226bd0a 100644
--- a/boost/spirit/home/karma/auxiliary/attr_cast.hpp
+++ b/boost/spirit/home/karma/auxiliary/attr_cast.hpp
@@ -31,9 +31,7 @@ namespace boost { namespace spirit
namespace boost { namespace spirit { namespace karma
{
-#ifndef BOOST_SPIRIT_NO_PREDEFINED_TERMINALS
using spirit::attr_cast;
-#endif
///////////////////////////////////////////////////////////////////////////
// attr_cast_generator consumes the attribute of subject generator without
diff --git a/boost/spirit/home/karma/char/char.hpp b/boost/spirit/home/karma/char/char.hpp
index 0d9b4f6b28..7992aebbad 100644
--- a/boost/spirit/home/karma/char/char.hpp
+++ b/boost/spirit/home/karma/char/char.hpp
@@ -180,7 +180,7 @@ namespace boost { namespace spirit { namespace karma
bool test(Attribute const& attr, CharParam& ch_, Context&) const
{
// fail if attribute isn't matched my immediate literal
- ch_ = attr;
+ ch_ = static_cast<char_type>(attr);
return attr == ch;
}
diff --git a/boost/spirit/home/karma/detail/alternative_function.hpp b/boost/spirit/home/karma/detail/alternative_function.hpp
index 54906b256e..8e369b42e3 100644
--- a/boost/spirit/home/karma/detail/alternative_function.hpp
+++ b/boost/spirit/home/karma/detail/alternative_function.hpp
@@ -90,7 +90,7 @@ namespace boost { namespace spirit { namespace karma { namespace detail
component; // suppresses warning: C4100: 'component' : unreferenced formal parameter
#endif
return call(component, sink, ctx, d, attr
- , spirit::traits::not_is_variant<Attribute, karma::domain>());
+ , spirit::traits::not_is_variant_or_variant_in_optional<Attribute, karma::domain>());
}
template <typename OutputIterator, typename Context, typename Delimiter>
diff --git a/boost/spirit/home/karma/detail/output_iterator.hpp b/boost/spirit/home/karma/detail/output_iterator.hpp
index 87980b7690..75c984a9bc 100644
--- a/boost/spirit/home/karma/detail/output_iterator.hpp
+++ b/boost/spirit/home/karma/detail/output_iterator.hpp
@@ -304,7 +304,7 @@ namespace boost { namespace spirit { namespace karma { namespace detail
struct no_buffering_policy
{
no_buffering_policy() {}
- no_buffering_policy(no_counting_policy const&) {}
+ no_buffering_policy(no_buffering_policy const&) {}
template <typename T>
bool output(T const& /*value*/)
diff --git a/boost/spirit/home/karma/numeric/detail/real_utils.hpp b/boost/spirit/home/karma/numeric/detail/real_utils.hpp
index 526985d280..84ea67dd4b 100644
--- a/boost/spirit/home/karma/numeric/detail/real_utils.hpp
+++ b/boost/spirit/home/karma/numeric/detail/real_utils.hpp
@@ -105,7 +105,13 @@ namespace boost { namespace spirit { namespace karma
if (exp != -dim)
++exp;
dim = static_cast<U>(-exp);
- n *= spirit::traits::pow10<U>(exp);
+ // detect and handle denormalized numbers to prevent overflow in pow10
+ if (exp > std::numeric_limits<U>::max_exponent10)
+ {
+ n *= spirit::traits::pow10<U>(std::numeric_limits<U>::max_exponent10);
+ n *= spirit::traits::pow10<U>(exp - std::numeric_limits<U>::max_exponent10);
+ } else
+ n *= spirit::traits::pow10<U>(exp);
}
}
diff --git a/boost/spirit/home/karma/stream/ostream_iterator.hpp b/boost/spirit/home/karma/stream/ostream_iterator.hpp
index 8a517287a7..0aabfac149 100644
--- a/boost/spirit/home/karma/stream/ostream_iterator.hpp
+++ b/boost/spirit/home/karma/stream/ostream_iterator.hpp
@@ -25,9 +25,13 @@ namespace boost { namespace spirit { namespace karma
typename T, typename Elem = char
, typename Traits = std::char_traits<Elem> >
class ostream_iterator
- : public std::iterator<std::output_iterator_tag, void, void, void, void>
{
public:
+ typedef std::output_iterator_tag iterator_category;
+ typedef void value_type;
+ typedef void difference_type;
+ typedef void pointer;
+ typedef void reference;
typedef Elem char_type;
typedef Traits traits_type;
typedef std::basic_ostream<Elem, Traits> ostream_type;