Do not include <iosfwd> or declare operator<< when BOOST_NO_IOSTREAM is defined. Fixes #43.

This commit is contained in:
Peter Dimov
2025-03-21 17:00:47 +02:00
parent 35c2046264
commit 5dcb2af521

View File

@ -9,11 +9,14 @@
#include <boost/config.hpp>
#include <boost/cstdint.hpp>
#include <iosfwd>
#include <string>
#include <cstdio>
#include <cstring>
#if !defined(BOOST_NO_IOSTREAM)
#include <iosfwd>
#endif
#if defined(__cpp_lib_source_location) && __cpp_lib_source_location >= 201907L
# include <source_location>
#endif
@ -132,12 +135,16 @@ public:
}
};
#if !defined(BOOST_NO_IOSTREAM)
template<class E, class T> std::basic_ostream<E, T> & operator<<( std::basic_ostream<E, T> & os, source_location const & loc )
{
os << loc.to_string();
return os;
}
#endif
} // namespace boost
#if defined(BOOST_DISABLE_CURRENT_LOCATION)