mirror of
https://github.com/boostorg/optional.git
synced 2025-07-29 20:17:21 +02:00
Add support for BOOST_NO_IOSTREAM
This commit is contained in:
@ -18,7 +18,9 @@
|
||||
#define BOOST_OPTIONAL_OPTIONAL_FLC_19NOV2002_HPP
|
||||
|
||||
#include <new>
|
||||
#ifndef BOOST_NO_IOSTREAM
|
||||
#include <iosfwd>
|
||||
#endif // BOOST_NO_IOSTREAM
|
||||
|
||||
#ifdef BOOST_OPTIONAL_DETAIL_USE_STD_TYPE_TRAITS
|
||||
# include <type_traits>
|
||||
@ -1586,6 +1588,7 @@ get_pointer ( optional<T>& opt )
|
||||
|
||||
} // namespace boost
|
||||
|
||||
#ifndef BOOST_NO_IOSTREAM
|
||||
namespace boost {
|
||||
|
||||
// The following declaration prevents a bug where operator safe-bool is used upon streaming optional object if you forget the IO header.
|
||||
@ -1598,6 +1601,7 @@ operator<<(std::basic_ostream<CharType, CharTrait>& os, optional_detail::optiona
|
||||
}
|
||||
|
||||
} // namespace boost
|
||||
#endif // BOOST_NO_IOSTREAM
|
||||
|
||||
#include <boost/optional/detail/optional_relops.hpp>
|
||||
#include <boost/optional/detail/optional_swap.hpp>
|
||||
|
@ -12,6 +12,7 @@
|
||||
#ifndef BOOST_OPTIONAL_OPTIONAL_IO_FLC_19NOV2002_HPP
|
||||
#define BOOST_OPTIONAL_OPTIONAL_IO_FLC_19NOV2002_HPP
|
||||
|
||||
#ifndef BOOST_NO_IOSTREAM
|
||||
#include <istream>
|
||||
#include <ostream>
|
||||
|
||||
@ -31,7 +32,7 @@ operator<<(std::basic_ostream<CharType, CharTrait>& out, none_t)
|
||||
{
|
||||
out << "--";
|
||||
}
|
||||
|
||||
|
||||
return out;
|
||||
}
|
||||
|
||||
@ -90,5 +91,5 @@ operator>>(std::basic_istream<CharType, CharTrait>& in, optional<T>& v)
|
||||
|
||||
} // namespace boost
|
||||
|
||||
#endif // BOOST_NO_IOSTREAM
|
||||
#endif
|
||||
|
||||
|
Reference in New Issue
Block a user