diff --git a/doc/91_relnotes.qbk b/doc/91_relnotes.qbk index 82dad14..3c1736a 100644 --- a/doc/91_relnotes.qbk +++ b/doc/91_relnotes.qbk @@ -11,6 +11,10 @@ [section:relnotes Release Notes] +[heading Boost Release 1.77] + +* Fixed [@https://github.com/boostorg/optional/issues/92 issue #92]. + [heading Boost Release 1.76] * Fixed MSVC warning C4702. diff --git a/doc/html/boost_optional/relnotes.html b/doc/html/boost_optional/relnotes.html index f973c6d..560e728 100644 --- a/doc/html/boost_optional/relnotes.html +++ b/doc/html/boost_optional/relnotes.html @@ -28,6 +28,15 @@

+ Boost + Release 1.77 +

+
+

+ Boost Release 1.76

@@ -35,7 +44,7 @@ Fixed MSVC warning C4702.

- + Boost Release 1.75

@@ -49,7 +58,7 @@

- + Boost Release 1.73

@@ -72,7 +81,7 @@

- + Boost Release 1.69

@@ -90,7 +99,7 @@

- + Boost Release 1.68

@@ -107,7 +116,7 @@

- + Boost Release 1.67

@@ -121,7 +130,7 @@

- + Boost Release 1.66

@@ -139,7 +148,7 @@

- + Boost Release 1.63

@@ -163,7 +172,7 @@

- + Boost Release 1.62

@@ -171,7 +180,7 @@ Fixed Trac #12179.

- + Boost Release 1.61

@@ -214,7 +223,7 @@

- + Boost Release 1.60

@@ -225,7 +234,7 @@ #11203.

- + Boost Release 1.59

@@ -239,7 +248,7 @@

- + Boost Release 1.58

@@ -275,7 +284,7 @@

- + Boost Release 1.57

@@ -285,7 +294,7 @@ to fix C++03 compile error on logic_error("...")".

- + Boost Release 1.56

diff --git a/doc/html/index.html b/doc/html/index.html index f97beec..98420b8 100644 --- a/doc/html/index.html +++ b/doc/html/index.html @@ -145,7 +145,7 @@ - +

Last revised: December 18, 2020 at 22:54:39 GMT

Last revised: May 19, 2021 at 21:27:41 GMT


diff --git a/include/boost/optional/optional.hpp b/include/boost/optional/optional.hpp index aadc975..1c30327 100644 --- a/include/boost/optional/optional.hpp +++ b/include/boost/optional/optional.hpp @@ -18,7 +18,9 @@ #define BOOST_OPTIONAL_OPTIONAL_FLC_19NOV2002_HPP #include +#ifndef BOOST_NO_IOSTREAM #include +#endif // BOOST_NO_IOSTREAM #ifdef BOOST_OPTIONAL_DETAIL_USE_STD_TYPE_TRAITS # include @@ -1586,6 +1588,7 @@ get_pointer ( optional& 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& os, optional_detail::optiona } } // namespace boost +#endif // BOOST_NO_IOSTREAM #include #include diff --git a/include/boost/optional/optional_io.hpp b/include/boost/optional/optional_io.hpp index ce81b68..3db6dda 100644 --- a/include/boost/optional/optional_io.hpp +++ b/include/boost/optional/optional_io.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 #include @@ -31,7 +32,7 @@ operator<<(std::basic_ostream& out, none_t) { out << "--"; } - + return out; } @@ -90,5 +91,5 @@ operator>>(std::basic_istream& in, optional& v) } // namespace boost +#endif // BOOST_NO_IOSTREAM #endif - diff --git a/test/optional_test.cpp b/test/optional_test.cpp index a0fa5a6..f5ca436 100644 --- a/test/optional_test.cpp +++ b/test/optional_test.cpp @@ -12,7 +12,9 @@ // Revisions: // 12 May 2008 (added more swap tests) // +#ifndef BOOST_NO_IOSTREAM #include +#endif // BOOST_NO_IOSTREAM #include #include @@ -908,7 +910,7 @@ void test_no_implicit_conversions() // Test for support for classes with overridden operator& -class CustomAddressOfClass +class CustomAddressOfClass { int n; @@ -950,5 +952,3 @@ int main() return boost::report_errors(); } - - diff --git a/test/optional_test_io.cpp b/test/optional_test_io.cpp index 14c2b26..8086c11 100644 --- a/test/optional_test_io.cpp +++ b/test/optional_test_io.cpp @@ -10,15 +10,19 @@ // You are welcome to contact the author at: // fernando_cacciola@hotmail.com -#include #include "boost/optional/optional.hpp" #include "boost/optional/optional_io.hpp" +#include "boost/core/lightweight_test.hpp" + +#ifndef BOOST_NO_IOSTREAM + +#include #ifdef BOOST_BORLANDC #pragma hdrstop #endif -#include "boost/core/lightweight_test.hpp" + using boost::optional; @@ -29,7 +33,7 @@ void test2( Opt o, Opt buff ) const int markv = 123 ; int mark = 0 ; - + s << o << " " << markv ; s >> buff >> mark ; @@ -85,3 +89,12 @@ int main() return boost::report_errors(); } + +#else // BOOST_NO_IOSTREAM + +int main() +{ + return boost::report_errors(); +} + +#endif // BOOST_NO_IOSTREAM