From d0ab8004c016dc71366f6624856595713df061ae Mon Sep 17 00:00:00 2001 From: Andrzej Krzemienski Date: Wed, 19 May 2021 23:29:10 +0200 Subject: [PATCH 01/10] Add support for BOOST_NO_IOSTREAM --- doc/91_relnotes.qbk | 4 +++ doc/html/boost_optional/relnotes.html | 37 ++++++++++++++++---------- doc/html/index.html | 2 +- include/boost/optional/optional.hpp | 4 +++ include/boost/optional/optional_io.hpp | 5 ++-- test/optional_test.cpp | 6 ++--- test/optional_test_io.cpp | 19 ++++++++++--- 7 files changed, 54 insertions(+), 23 deletions(-) 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 From 0b159febf8c43ac3124df4bfa722c450a8ffd718 Mon Sep 17 00:00:00 2001 From: Peter Dimov Date: Thu, 10 Jun 2021 00:53:07 +0300 Subject: [PATCH 02/10] Update CMakeLists.txt --- CMakeLists.txt | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 3c836a4..f60acf5 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -1,12 +1,9 @@ # Copyright 2019 Mike Dev # Distributed under the Boost Software License, Version 1.0. # See accompanying file LICENSE_1_0.txt or copy at https://www.boost.org/LICENSE_1_0.txt -# -# NOTE: CMake support for Boost.Optional is currently experimental at best -# and the interface is likely to change in the future -cmake_minimum_required( VERSION 3.5 ) -project( BoostOptional ) +cmake_minimum_required( VERSION 3.5...3.20 ) +project( boost_optional VERSION "${BOOST_SUPERPROJECT_VERSION}" LANGUAGES CXX ) add_library( boost_optional INTERFACE ) add_library( Boost::optional ALIAS boost_optional ) From 14d43d2e6e2bf14a0d5b207c14d6fe710ada265c Mon Sep 17 00:00:00 2001 From: sdarwin Date: Fri, 30 Jul 2021 16:10:11 +0000 Subject: [PATCH 03/10] Update GitHub Actions CI file --- .github/workflows/ci.yml | 48 ++++++++++++++++++++++++++-------------- 1 file changed, 31 insertions(+), 17 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 378a30e..ec7e4cb 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -21,7 +21,8 @@ jobs: buildtype: "boost" packages: "" packages_to_remove: "" - os: "ubuntu-16.04" + os: "ubuntu-20.04" + container: "ubuntu:16.04" cxx: "g++" sources: "" llvm_os: "" @@ -33,7 +34,8 @@ jobs: buildtype: "boost" packages: "g++-4.7" packages_to_remove: "" - os: "ubuntu-16.04" + os: "ubuntu-20.04" + container: "ubuntu:16.04" cxx: "g++-4.7" sources: "" llvm_os: "" @@ -45,7 +47,8 @@ jobs: buildtype: "boost" packages: "g++-4.8" packages_to_remove: "" - os: "ubuntu-16.04" + os: "ubuntu-20.04" + container: "ubuntu:16.04" cxx: "g++-4.8" sources: "" llvm_os: "" @@ -57,7 +60,8 @@ jobs: buildtype: "boost" packages: "g++-4.9" packages_to_remove: "" - os: "ubuntu-16.04" + os: "ubuntu-20.04" + container: "ubuntu:16.04" cxx: "g++-4.9" sources: "" llvm_os: "" @@ -69,7 +73,8 @@ jobs: buildtype: "boost" packages: "g++-5" packages_to_remove: "" - os: "ubuntu-16.04" + os: "ubuntu-20.04" + container: "ubuntu:16.04" cxx: "g++-5" sources: "" llvm_os: "" @@ -81,7 +86,8 @@ jobs: buildtype: "boost" packages: "g++-6" packages_to_remove: "" - os: "ubuntu-16.04" + os: "ubuntu-20.04" + container: "ubuntu:16.04" cxx: "g++-6" sources: "" llvm_os: "" @@ -93,7 +99,8 @@ jobs: buildtype: "boost" packages: "g++-7" packages_to_remove: "" - os: "ubuntu-16.04" + os: "ubuntu-20.04" + container: "ubuntu:16.04" cxx: "g++-7" sources: "" llvm_os: "" @@ -105,7 +112,7 @@ jobs: buildtype: "boost" packages: "" packages_to_remove: "" - os: "ubuntu-16.04" + os: "ubuntu-18.04" cxx: "clang++" sources: "" llvm_os: "" @@ -117,7 +124,8 @@ jobs: buildtype: "boost" packages: "clang-3.5 libstdc++-4.9-dev" packages_to_remove: "" - os: "ubuntu-16.04" + os: "ubuntu-20.04" + container: "ubuntu:16.04" cxx: "clang++-3.5" sources: "" llvm_os: "precise" @@ -129,7 +137,8 @@ jobs: buildtype: "boost" packages: "clang-3.6" packages_to_remove: "" - os: "ubuntu-16.04" + os: "ubuntu-20.04" + container: "ubuntu:16.04" cxx: "clang++-3.6" sources: "" llvm_os: "precise" @@ -141,7 +150,8 @@ jobs: buildtype: "boost" packages: "clang-3.7" packages_to_remove: "" - os: "ubuntu-16.04" + os: "ubuntu-20.04" + container: "ubuntu:16.04" cxx: "clang++-3.7" sources: "" llvm_os: "precise" @@ -153,7 +163,8 @@ jobs: buildtype: "boost" packages: "clang-3.8 libstdc++-4.9-dev" packages_to_remove: "" - os: "ubuntu-16.04" + os: "ubuntu-20.04" + container: "ubuntu:16.04" cxx: "clang++-3.8" sources: "" llvm_os: "precise" @@ -165,7 +176,8 @@ jobs: buildtype: "boost" packages: "clang-3.9 libstdc++-4.9-dev" packages_to_remove: "" - os: "ubuntu-16.04" + os: "ubuntu-20.04" + container: "ubuntu:16.04" cxx: "clang++-3.9" sources: "" llvm_os: "precise" @@ -177,7 +189,7 @@ jobs: buildtype: "boost" packages: "clang-4.0" packages_to_remove: "" - os: "ubuntu-16.04" + os: "ubuntu-20.04" container: "ubuntu:14.04" cxx: "clang++-4.0" sources: "" @@ -190,7 +202,7 @@ jobs: buildtype: "boost" packages: "clang-5.0" packages_to_remove: "" - os: "ubuntu-16.04" + os: "ubuntu-20.04" container: "ubuntu:14.04" cxx: "clang++-5.0" sources: "" @@ -210,10 +222,12 @@ jobs: - name: If running in container, upgrade packages if: matrix.container != '' run: | - sudo apt-get -o Acquire::Retries=3 update && DEBIAN_FRONTEND=noninteractive apt-get -y install tzdata && apt-get -o Acquire::Retries=3 install -y sudo software-properties-common wget curl apt-transport-https make apt-file sudo unzip libssl-dev build-essential autotools-dev autoconf automake g++ libc++-helpers python python-pip ruby cpio gcc-multilib g++-multilib pkgconf python3 python3-pip ccache libpython-dev + apt-get -o Acquire::Retries=3 update && DEBIAN_FRONTEND=noninteractive apt-get -y install tzdata && apt-get -o Acquire::Retries=3 install -y sudo software-properties-common wget curl apt-transport-https make apt-file sudo unzip libssl-dev build-essential autotools-dev autoconf automake g++ libc++-helpers python ruby cpio gcc-multilib g++-multilib pkgconf python3 ccache libpython-dev sudo apt-add-repository ppa:git-core/ppa sudo apt-get -o Acquire::Retries=3 update && apt-get -o Acquire::Retries=3 -y install git - sudo python -m pip install --upgrade pip==20.3.4 + python_version=$(python3 -c 'import sys; print("{0.major}.{0.minor}".format(sys.version_info))') + sudo wget https://bootstrap.pypa.io/pip/$python_version/get-pip.py + sudo python3 get-pip.py sudo /usr/local/bin/pip install cmake - uses: actions/checkout@v2 From 7dd512a0196205f45a481bbbc302f8bf4d92626e Mon Sep 17 00:00:00 2001 From: Andrzej Krzemienski Date: Sat, 20 Nov 2021 02:00:30 +0100 Subject: [PATCH 04/10] Fix issue #98 --- doc/00_optional.qbk | 2 +- doc/91_relnotes.qbk | 6 +- doc/html/boost_optional/acknowledgements.html | 2 +- .../dependencies_and_portability.html | 2 +- ...emplace_operations_in_older_compilers.html | 2 +- .../optional_reference_binding.html | 2 +- doc/html/boost_optional/quick_start.html | 2 +- ...sing_unnecessary_default_construction.html | 2 +- .../optional_automatic_variables.html | 2 +- .../quick_start/optional_data_members.html | 2 +- .../quick_start/storage_in_containers.html | 2 +- ...ost_optional_bad_optional_access_hpp_.html | 2 +- .../detailed_semantics.html | 2 +- .../header__boost_optional_hpp_.html | 2 +- ...der__boost_optional_optional_fwd_hpp_.html | 2 +- .../detailed_semantics___free_functions.html | 2 +- ...ailed_semantics___optional_references.html | 2 +- .../detailed_semantics___optional_values.html | 2 +- .../header_optional_in_place_init.html | 2 +- .../header_optional_optional_refs.html | 2 +- .../header_optional_optional_values.html | 2 +- .../boost_optional/reference/io_header.html | 2 +- .../reference/io_header/io_semantics.html | 2 +- doc/html/boost_optional/relnotes.html | 41 ++++++---- .../tutorial/design_overview.html | 2 +- .../design_overview/the_interface.html | 2 +- .../design_overview/the_semantics.html | 2 +- .../tutorial/exception_safety_guarantees.html | 2 +- doc/html/boost_optional/tutorial/gotchas.html | 2 +- ...e_positive_with__wmaybe_uninitialized.html | 2 +- .../gotchas/mixed_relational_comparisons.html | 2 +- .../gotchas/moved_from__optional_.html | 2 +- .../tutorial/in_place_factories.html | 2 +- .../boost_optional/tutorial/io_operators.html | 2 +- .../tutorial/optional_references.html | 2 +- ...for_assignment_of_optional_references.html | 2 +- .../tutorial/performance_considerations.html | 2 +- .../tutorial/relational_operators.html | 2 +- .../tutorial/type_requirements.html | 2 +- .../tutorial/when_to_use_optional.html | 2 +- doc/html/index.html | 4 +- doc/html/optional/reference.html | 2 +- .../header__boost_optional_optional_hpp_.html | 2 +- doc/html/optional/tutorial.html | 2 +- include/boost/optional/optional.hpp | 79 ++++++++++++++++--- test/Jamfile.v2 | 1 + test/optional_test_convert_assign.cpp | 57 +++++++++++++ 47 files changed, 198 insertions(+), 72 deletions(-) create mode 100644 test/optional_test_convert_assign.cpp diff --git a/doc/00_optional.qbk b/doc/00_optional.qbk index fd7d014..e48c8e4 100644 --- a/doc/00_optional.qbk +++ b/doc/00_optional.qbk @@ -2,7 +2,7 @@ [quickbook 1.4] [authors [Cacciola Carballal, Fernando Luis]] [copyright 2003-2007 Fernando Luis Cacciola Carballal] - [copyright 2014-2020 Andrzej Krzemieński] + [copyright 2014-2021 Andrzej Krzemieński] [category miscellaneous] [id optional] [dirname optional] diff --git a/doc/91_relnotes.qbk b/doc/91_relnotes.qbk index 3c1736a..d61b289 100644 --- a/doc/91_relnotes.qbk +++ b/doc/91_relnotes.qbk @@ -1,7 +1,7 @@ [/ Boost.Optional - Copyright (c) 2015 - 2018 Andrzej Krzemienski + Copyright (c) 2015 - 2021 Andrzej Krzemienski Distributed under the Boost Software License, Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at @@ -11,6 +11,10 @@ [section:relnotes Release Notes] +[heading Boost Release 1.79] + +* Fixed [@https://github.com/boostorg/optional/issues/98 issue #98]. + [heading Boost Release 1.77] * Fixed [@https://github.com/boostorg/optional/issues/92 issue #92]. diff --git a/doc/html/boost_optional/acknowledgements.html b/doc/html/boost_optional/acknowledgements.html index 56c6f5c..5419580 100644 --- a/doc/html/boost_optional/acknowledgements.html +++ b/doc/html/boost_optional/acknowledgements.html @@ -116,7 +116,7 @@ -
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-

+ Boost + Release 1.79 +

+
+

+ Boost Release 1.77

@@ -36,7 +45,7 @@ #92.

- + Boost Release 1.76

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

- + Boost Release 1.75

@@ -58,7 +67,7 @@

- + Boost Release 1.73

@@ -81,7 +90,7 @@

- + Boost Release 1.69

@@ -99,7 +108,7 @@

- + Boost Release 1.68

@@ -116,7 +125,7 @@

- + Boost Release 1.67

@@ -130,7 +139,7 @@

- + Boost Release 1.66

@@ -148,7 +157,7 @@

- + Boost Release 1.63

@@ -172,7 +181,7 @@

- + Boost Release 1.62

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

- + Boost Release 1.61

@@ -223,7 +232,7 @@

- + Boost Release 1.60

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

- + Boost Release 1.59

@@ -248,7 +257,7 @@

- + Boost Release 1.58

@@ -284,7 +293,7 @@

- + Boost Release 1.57

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

- + Boost Release 1.56

@@ -351,7 +360,7 @@ -
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
+

Distributed under the Boost Software License, Version 1.0. (See accompanying @@ -145,7 +145,7 @@

- +

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

Last revised: November 20, 2021 at 00:57:52 GMT


diff --git a/doc/html/optional/reference.html b/doc/html/optional/reference.html index 8ab0bfe..1cbeafa 100644 --- a/doc/html/optional/reference.html +++ b/doc/html/optional/reference.html @@ -75,7 +75,7 @@ -
-
-