Skip to content

Commit

Permalink
Fix missing includes in match_manip.hpp.
Browse files Browse the repository at this point in the history
Use failbit as a dependent name to avoid having to include <ios>
for std::ios_base::failbit.

Add missing includes for enable_if, mpl::true_/mpl::false_ and scoped
enums.
  • Loading branch information
Lastique committed Oct 8, 2023
1 parent ba5026b commit 880efca
Show file tree
Hide file tree
Showing 9 changed files with 24 additions and 13 deletions.
10 changes: 6 additions & 4 deletions include/boost/spirit/home/karma/stream/detail/format_manip.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -10,10 +10,12 @@
#pragma once
#endif

#include <iosfwd>
#include <iterator>
#include <string>
#include <boost/spirit/home/karma/generate.hpp>
#include <boost/spirit/home/support/iterators/ostream_iterator.hpp>
#include <boost/core/scoped_enum.hpp>
#include <boost/mpl/bool.hpp>

///////////////////////////////////////////////////////////////////////////////
Expand Down Expand Up @@ -148,7 +150,7 @@ namespace boost { namespace spirit { namespace karma { namespace detail
karma::ostream_iterator<Char, Char, Traits> sink(os);
if (!karma::generate (sink, fm.expr))
{
os.setstate(std::ios_base::failbit);
os.setstate(std::basic_ostream<Char, Traits>::failbit);
}
return os;
}
Expand All @@ -163,7 +165,7 @@ namespace boost { namespace spirit { namespace karma { namespace detail
karma::ostream_iterator<Char, Char, Traits> sink(os);
if (!karma::generate(sink, fm.expr, fm.attr))
{
os.setstate(std::ios_base::failbit);
os.setstate(std::basic_ostream<Char, Traits>::failbit);
}
return os;
}
Expand All @@ -177,7 +179,7 @@ namespace boost { namespace spirit { namespace karma { namespace detail
karma::ostream_iterator<Char, Char, Traits> sink(os);
if (!karma::generate_delimited(sink, fm.expr, fm.delim, fm.pre))
{
os.setstate(std::ios_base::failbit);
os.setstate(std::basic_ostream<Char, Traits>::failbit);
}
return os;
}
Expand All @@ -193,7 +195,7 @@ namespace boost { namespace spirit { namespace karma { namespace detail
karma::ostream_iterator<Char, Char, Traits> sink(os);
if (!karma::generate_delimited(sink, fm.expr, fm.delim, fm.pre, fm.attr))
{
os.setstate(std::ios_base::failbit);
os.setstate(std::basic_ostream<Char, Traits>::failbit);
}
return os;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,8 @@

#include <boost/spirit/home/karma/stream/detail/format_manip.hpp>
#include <boost/spirit/home/karma/auto/create_generator.hpp>
#include <boost/utility/enable_if.hpp>
#include <boost/core/enable_if.hpp>
#include <boost/mpl/bool.hpp>

///////////////////////////////////////////////////////////////////////////////
namespace boost { namespace spirit { namespace karma { namespace detail
Expand Down
4 changes: 3 additions & 1 deletion include/boost/spirit/home/karma/stream/format_manip.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,8 @@
#include <boost/spirit/home/karma/detail/output_iterator.hpp>
#include <boost/spirit/home/karma/stream/detail/format_manip.hpp>
#include <boost/spirit/home/support/unused.hpp>
#include <boost/mpl/bool.hpp>
#include <iosfwd>

///////////////////////////////////////////////////////////////////////////////
namespace boost { namespace spirit { namespace karma
Expand Down Expand Up @@ -107,7 +109,7 @@ namespace boost { namespace spirit { namespace karma

if (!g.derived().generate(sink, unused, unused, unused))
{
os.setstate(std::ios_base::failbit);
os.setstate(std::basic_ostream<Char, Traits>::failbit);
}
return os;
}
Expand Down
2 changes: 2 additions & 0 deletions include/boost/spirit/home/karma/stream/format_manip_attr.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,9 @@

#include <boost/spirit/home/karma/stream/format_manip.hpp>

#include <boost/mpl/bool.hpp>
#include <boost/fusion/include/vector.hpp>
#include <boost/preprocessor/cat.hpp>
#include <boost/preprocessor/iterate.hpp>
#include <boost/preprocessor/repetition/enum.hpp>
#include <boost/preprocessor/repetition/enum_params.hpp>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@
#pragma once
#endif

#include <iosfwd>
#include <iterator>

///////////////////////////////////////////////////////////////////////////////
Expand Down
3 changes: 2 additions & 1 deletion include/boost/spirit/home/karma/stream/stream.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,8 @@
#include <boost/fusion/include/at.hpp>
#include <boost/fusion/include/vector.hpp>
#include <boost/fusion/include/cons.hpp>
#include <boost/utility/enable_if.hpp>
#include <boost/core/enable_if.hpp>
#include <boost/mpl/bool.hpp>
#include <boost/type_traits/is_same.hpp>
#include <ostream>

Expand Down
9 changes: 5 additions & 4 deletions include/boost/spirit/home/qi/stream/detail/match_manip.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@
#include <boost/spirit/home/qi/parse.hpp>
#include <boost/spirit/home/support/iterators/istream_iterator.hpp>
#include <boost/spirit/home/support/unused.hpp>
#include <boost/core/enable_if.hpp>
#include <boost/mpl/bool.hpp>

#include <iosfwd>
Expand Down Expand Up @@ -155,7 +156,7 @@ namespace boost { namespace spirit { namespace qi { namespace detail
input_iterator l;
if (!qi::parse(f, l, fm.expr))
{
is.setstate(std::ios_base::failbit);
is.setstate(std::basic_istream<Char, Traits>::failbit);
}
return is;
}
Expand All @@ -174,7 +175,7 @@ namespace boost { namespace spirit { namespace qi { namespace detail
input_iterator l;
if (!qi::parse(f, l, fm.expr, fm.attr))
{
is.setstate(std::ios_base::failbit);
is.setstate(std::basic_istream<Char, Traits>::failbit);
}
return is;
}
Expand All @@ -194,7 +195,7 @@ namespace boost { namespace spirit { namespace qi { namespace detail
if (!qi::phrase_parse(
f, l, fm.expr, fm.skipper, fm.post_skip))
{
is.setstate(std::ios_base::failbit);
is.setstate(std::basic_istream<Char, Traits>::failbit);
}
return is;
}
Expand All @@ -216,7 +217,7 @@ namespace boost { namespace spirit { namespace qi { namespace detail
if (!qi::phrase_parse(
f, l, fm.expr, fm.skipper, fm.post_skip, fm.attr))
{
is.setstate(std::ios_base::failbit);
is.setstate(std::basic_istream<Char, Traits>::failbit);
}
return is;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@

#include <boost/spirit/home/qi/stream/detail/match_manip.hpp>
#include <boost/spirit/home/qi/auto/create_parser.hpp>
#include <boost/utility/enable_if.hpp>
#include <boost/core/enable_if.hpp>

///////////////////////////////////////////////////////////////////////////////
namespace boost { namespace spirit { namespace qi { namespace detail
Expand Down
3 changes: 2 additions & 1 deletion include/boost/spirit/home/qi/stream/match_manip.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@
#include <boost/spirit/home/qi/parser.hpp>
#include <boost/spirit/home/support/unused.hpp>
#include <boost/spirit/home/qi/stream/detail/match_manip.hpp>
#include <boost/mpl/bool.hpp>
#include <iosfwd>

///////////////////////////////////////////////////////////////////////////////
Expand Down Expand Up @@ -113,7 +114,7 @@ namespace boost { namespace spirit { namespace qi
input_iterator l;
if (!p.derived().parse(f, l, unused, unused, unused))
{
is.setstate(std::ios_base::failbit);
is.setstate(std::basic_istream<Char, Traits>::failbit);
}
return is;
}
Expand Down

0 comments on commit 880efca

Please sign in to comment.