outcome v2.1.2 Release Notes
Release Date: 2019-12-18 // over 4 years ago-
๐ v2.1.2 11th December 2019 (Boost 1.72) [release]
โจ Enhancements:
๐ Improved compatibility with cmake tooling
๐ฆ : Standalone outcome is nowmake install
-able, and cmakefind_package()
can find it.
๐ฆ Note that you must separately install andfind_package()
Outcome's dependency, quickcpplib,
๐ฆ elsefind_package()
of Outcome will fail.0๏ธโฃ Non-permissive parsing is now default in Visual Studio
0๏ธโฃ : The default targets in standalone Outcome's cmake now enable non-permissive parsing.
This was required partially because VS2019 16.3's quite buggy Concepts implementation is
๐ unusuable in permissive parsing mode. Even then, lazy ADL two phase lookup is broken
โ in VS2019 16.3 with/std:latest
, you may wish to use an earlier language standard.๐ฅ Breaking change!
: The git submodule mechanism used by standalone Outcome of specifying dependent libraries
has been replaced with a cmake superbuild of dependencies mechanism instead. Upon cmake
๐ง configure, an internal copy of quickcpplib will be git cloned, built and installed into the
๐ build directory from where an internalfind_package()
uses it. This breaks the use of
the unconfigured Outcome repo as an implementation of Outcome, one must now do one of:๐ 1. Add Outcome as subdirectory to cmake build. ๐ 2. Use cmake superbuild (i.e.
ExternalProject_Add()
) to build and install Outcome into
a local installation.- Use one of the single header editions.
๐ฅ Breaking change!
: For standalone Outcome, the current compiler is now checked for whether it will compile
code containing C++ Concepts, and if it does, all cmake consumers of Outcome will enable
C++ Concepts. Set the cmake variableCXX_CONCEPTS_FLAGS
to an empty string to prevent
๐ auto detection and enabling of C++ Concepts support occurring.OUTCOME_TRY
operation now hints to the compiler that operation will be successful
: P1886 Error speed benchmarking showed that there is
considerable gain in very small functions by hinting to the compiler whether the expression
is expected to be successful or not.OUTCOME_TRY
previously did not hint to the compiler
at all, but now it does. A new suite of macrosOUTCOME_TRY_FAILURE_LIKELY
hint to the
compiler that failure is expected. If you wish to return to the previously unhinted
behaviour, defineOUTCOME_TRY_LIKELY(expr)
to(!!expr)
.#199
๐ : Support for C++ Coroutines has been added. This comes in two parts, firstly there is
now anOUTCOME_CO_TRY()
operation suitable for performing theTRY
operation from
๐ within a C++ Coroutine. Secondly, in the headeroutcome/coroutine_support.hpp
there are
implementations ofeager<OutcomeType>
andlazy<OutcomeType>
which let you more
naturally and efficiently usebasic_result
orbasic_outcome
from within C++
๐ป Coroutines -- specifically, if the result or outcome will construct from an exception
pointer, exceptions thrown in the coroutine return an errored or excepted result with
๐ป the thrown exception instead of throwing the exception through the coroutine machinery
(which in current compilers, has a high likelihood of blowing up the program). Both
โeager<T>
andlazy<T>
can accept anyT
as well. Both have been tested and found
working on VS2019 and clang 9.#210
:make_error_code()
andmake_exception_ptr()
are now additionally considered for
๐ compatible copy and move conversions forbasic_result<>
. This lets you construct
abasic_result<T, E>
into abasic_result<T, error_code>
, whereE
is a
๐ custom type which has implemented the ADL discovered free function
error_code make_error_code(E)
, but is otherwise unrelated toerror_code
.
The same availability applies forexception_ptr
withmake_exception_ptr()
being
๐ the ADL discovered free function.basic_outcome<>
has less support for this than
basic_result<>
in order to keep constructor count down, but it will accept via
this mechanism conversions frombasic_result<>
andfailure_type<>
.๐ Bug fixes:
#184
๐ : The detection of[[nodiscard]]
support in the compiler was very mildly broken.