Skip to content

Commit 5dcb2af

Browse files
committed
Do not include <iosfwd> or declare operator<< when BOOST_NO_IOSTREAM is defined. Fixes #43.
1 parent 35c2046 commit 5dcb2af

File tree

1 file changed

+8
-1
lines changed

1 file changed

+8
-1
lines changed

include/boost/assert/source_location.hpp

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,11 +9,14 @@
99

1010
#include <boost/config.hpp>
1111
#include <boost/cstdint.hpp>
12-
#include <iosfwd>
1312
#include <string>
1413
#include <cstdio>
1514
#include <cstring>
1615

16+
#if !defined(BOOST_NO_IOSTREAM)
17+
#include <iosfwd>
18+
#endif
19+
1720
#if defined(__cpp_lib_source_location) && __cpp_lib_source_location >= 201907L
1821
# include <source_location>
1922
#endif
@@ -132,12 +135,16 @@ struct source_location
132135
}
133136
};
134137

138+
#if !defined(BOOST_NO_IOSTREAM)
139+
135140
template<class E, class T> std::basic_ostream<E, T> & operator<<( std::basic_ostream<E, T> & os, source_location const & loc )
136141
{
137142
os << loc.to_string();
138143
return os;
139144
}
140145

146+
#endif
147+
141148
} // namespace boost
142149

143150
#if defined(BOOST_DISABLE_CURRENT_LOCATION)

0 commit comments

Comments
 (0)