From ead529af54a5776f01b7cedb2e551db844dda9e4 Mon Sep 17 00:00:00 2001 From: gieseanw Date: Fri, 18 Dec 2020 11:13:47 -0600 Subject: [PATCH] Address unreachable code warning In MSVC optional::value() emits a warning C4702: unreachable code because throw_exception is marked BOOST_RETURN. Otherwise the ternary code might have been preferable. This change addresses the warning while preserving the functionality. It replicates optional::value() for consistency. --- doc/00_optional.qbk | 8 ++--- doc/91_relnotes.qbk | 4 +++ 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 | 36 +++++++++++-------- .../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 +- .../detail/optional_reference_spec.hpp | 9 ++++- 45 files changed, 79 insertions(+), 62 deletions(-) diff --git a/doc/00_optional.qbk b/doc/00_optional.qbk index 00b6096..fd7d014 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-2018 Andrzej Krzemieński] + [copyright 2014-2020 Andrzej Krzemieński] [category miscellaneous] [id optional] [dirname optional] @@ -61,7 +61,7 @@ Suppose we want to read a parameter form a config file which represents some int This is how you solve it with `boost::optional`: #include - + boost::optional getConfigParam(std::string name); // return either an int or a `not-an-int` int main() @@ -71,7 +71,7 @@ This is how you solve it with `boost::optional`: else runWithNoMax(); } - + [endsect] [include 01_quick_start.qbk] @@ -102,5 +102,3 @@ This is how you solve it with `boost::optional`: [include 90_dependencies.qbk] [include 91_relnotes.qbk] [include 92_acknowledgments.qbk] - - diff --git a/doc/91_relnotes.qbk b/doc/91_relnotes.qbk index 79f881f..82dad14 100644 --- a/doc/91_relnotes.qbk +++ b/doc/91_relnotes.qbk @@ -11,6 +11,10 @@ [section:relnotes Release Notes] +[heading Boost Release 1.76] + +* Fixed MSVC warning C4702. + [heading Boost Release 1.75] * `boost::none` is `constexpr`-declared. diff --git a/doc/html/boost_optional/acknowledgements.html b/doc/html/boost_optional/acknowledgements.html index eff2ed8..56c6f5c 100644 --- a/doc/html/boost_optional/acknowledgements.html +++ b/doc/html/boost_optional/acknowledgements.html @@ -116,7 +116,7 @@ -
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-

+ Boost + Release 1.76 +

+
  • + Fixed MSVC warning C4702. +
+

+ Boost Release 1.75

@@ -41,7 +49,7 @@

- + Boost Release 1.73

@@ -64,7 +72,7 @@

- + Boost Release 1.69

@@ -82,7 +90,7 @@

- + Boost Release 1.68

@@ -99,7 +107,7 @@

- + Boost Release 1.67

@@ -113,7 +121,7 @@

- + Boost Release 1.66

@@ -131,7 +139,7 @@

- + Boost Release 1.63

@@ -155,7 +163,7 @@

- + Boost Release 1.62

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

- + Boost Release 1.61

@@ -206,7 +214,7 @@

- + Boost Release 1.60

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

- + Boost Release 1.59

@@ -231,7 +239,7 @@

- + Boost Release 1.58

@@ -267,7 +275,7 @@

- + Boost Release 1.57

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

- + Boost Release 1.56

@@ -334,7 +342,7 @@ -
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
+

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

- +

Last revised: October 24, 2020 at 15:15:55 GMT

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


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