Skip to content

Commit ee4e2b3

Browse files
committed
diagnostics refinements
1 parent a59198a commit ee4e2b3

File tree

4 files changed

+14
-17
lines changed

4 files changed

+14
-17
lines changed

include/boost/leaf/detail/demangle.hpp

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -23,8 +23,6 @@
2323
# include <string>
2424
#endif
2525

26-
#if BOOST_LEAF_CFG_DIAGNOSTICS
27-
2826
// __has_include is currently supported by GCC and Clang. However GCC 4.9 may have issues and
2927
// returns 1 for 'defined( __has_include )', while '__has_include' is actually not supported:
3028
// https://gcc.gnu.org/bugzilla/show_bug.cgi?id=63662
@@ -46,8 +44,6 @@
4644
# endif
4745
#endif
4846

49-
#endif // #if BOOST_LEAF_CFG_DIAGNOSTICS
50-
5147
namespace boost { namespace leaf {
5248

5349
namespace detail

include/boost/leaf/detail/diagnostics_writer.hpp

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,10 +8,22 @@
88
#include <boost/leaf/writer.hpp>
99
#include <boost/leaf/detail/exception_base.hpp>
1010

11-
#include <iosfwd>
11+
#include <boost/leaf/config.hpp>
12+
#include <type_traits>
13+
14+
#if BOOST_LEAF_CFG_DIAGNOSTICS
15+
# include <iostream>
16+
#else
17+
# include <iosfwd>
18+
#endif
1219

1320
namespace boost { namespace leaf {
1421

22+
template <class E>
23+
struct show_in_diagnostics: std::integral_constant<bool, BOOST_LEAF_CFG_DIAGNOSTICS>
24+
{
25+
};
26+
1527
namespace detail
1628
{
1729
template <class T, class E = void>

include/boost/leaf/error.hpp

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -9,11 +9,7 @@
99
#include <boost/leaf/detail/optional.hpp>
1010
#include <boost/leaf/detail/function_traits.hpp>
1111
#include <boost/leaf/detail/capture_list.hpp>
12-
13-
#if BOOST_LEAF_CFG_DIAGNOSTICS
14-
# include <boost/leaf/detail/diagnostics_writer.hpp>
15-
# include <ostream>
16-
#endif
12+
#include <boost/leaf/detail/diagnostics_writer.hpp>
1713

1814
#include <cstring>
1915

@@ -104,10 +100,8 @@ namespace detail
104100
void serialize_(Writer & w, E const & e)
105101
{
106102
serialize(w, e);
107-
#if BOOST_LEAF_CFG_DIAGNOSTICS
108103
if( detail::diagnostics_writer * ow = w.template get<detail::diagnostics_writer>() )
109104
ow->write(e);
110-
#endif
111105
}
112106
}
113107

include/boost/leaf/writer.hpp

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -21,11 +21,6 @@
2121

2222
namespace boost { namespace leaf {
2323

24-
template <class E>
25-
struct show_in_diagnostics: std::true_type
26-
{
27-
};
28-
2924
class writer
3025
{
3126
parsed const type_;

0 commit comments

Comments
 (0)