Releases: Sedeniono/tiny-optional
v1.5.2
v1.5.1
This release fixes the version number in the CMakeLists.txt file, which was forgotten and left as 1.4.0 in the previous v1.5.0 release. Please see the v1.5.0 release for the major changes in the 1.5.x release.
Full Changelog: v1.5.0...v1.5.1
v1.5.0
Major changes:
tiny::optional<T *>(i.e. pointers as payload) now uses a sentinel that also supports Intel 5-level paging (virtual addresses that use 57 bits). Moreover, the new sentinel was chosen such that it should work in all future extensions of the virtual address size, as long as not all 64 bits of the pointer is used. For more details, see commit 402ac93 and the source code comment modified in that commit.- If C++20 or above is used, the copy and move constructors, the copy and move assignment operators and the destructor of
tiny::optional(and related classes) are now trivial under the same conditions as forstd::optional. This means that faster code might be produced iftiny::optionalis used in container-like entities such asstd::vector, in case their implementation takes advantage of trivial special member functions. Note that in C++17 they are still never trivial; it would require a lot of boilerplate code and so far I think it is not worth the effort. - If C++20 or above is used, compile times are now up to 60% faster, depending on compiler and compilation flags. See the following image and the updated section in the readme on the build times. This was achieved by replacing a conditional inheritance hierarchy (i.e. several template classes) with overloads of constructors, destructor and assignment operators via C++20's
requiresclause.

Full Changelog: v1.4.0...v1.5.0
v1.4.0
Major changes:
- Added support for installation of the library via cmake. See the installation chapter in the readme.
- Starting with this version, different patch versions of the library are compatible with each other if the major and minor versions match. See the readme for more details.
Full Changelog: v1.3.1...v1.4.0
v1.3.1
Fixed: The Natvis file now works again after the previous release put all types into an inline namespace. Unfortunately, the Natvis file needs both the library version and the configuration hardcoded, so be aware that you need to update your copy of the Natvis file after updating the library or when compiling with TINY_OPTIONAL_USE_SEPARATE_BOOL_INSTEAD_OF_UB_TRICKS.
Full Changelog: v1.3.0...v1.3.1
v1.3.0
Major changes:
- Allow disabling all functionality that relies on undefined behavior (i.e. exploitation of unused bit patterns and storing the empty state in a member variable) by defining
TINY_OPTIONAL_USE_SEPARATE_BOOL_INSTEAD_OF_UB_TRICKS. This allows using the other parts of the library (custom sentinel; custom specializations oftiny::optional_flag_manipulator) on non-x86/x64 platforms. Updated the README to document this configuration option. - Added
TINY_OPTIONAL_VERSION, which is a preprocessor macro that specifies the version of the library. See its definition intiny/optional.hfor more information. - Actively prevent mixing of different versions or configurations. It could lead to all sorts of problems. This is done by defining the types in an inline namespace whose name contains the version number and the configuration.
Full Changelog: v1.2.1...v1.3.0
v1.2.1
Bugfix: Fixed Natvis when std::nullopt is not used in any translation unit. (Visual Studio fails to resolve std::nullopt in this case.)
Full Changelog: v1.2.0...v1.2.1
v1.2.0
Major changes:
- Added Natvis file to the
includedirectory. Add it to your own Natvis file to make debugging in Visual Studio easier. Also see the corresponding chapter in the readme for more information. - Added
tiny::optional::is_compressedto allow checking whether a given optional uses more memory than the payload. - Added
tiny::is_tiny_optional_v<T>which is true ifTis atiny::optional(or some other optional defined by this library). - Updated and improved github workflows.
Full Changelog: v1.1.1...v1.2.0
v1.1.1
v1.1.0
Major changes:
- Introduced customization point
tiny::optional_flag_manipulator, which allows the user to teachtiny::optional<PayloadType>about a custom "flag manipulator" for some custom typePayloadType. If available,tiny::optional<PayloadType>will always have the same size as thePayloadType. Hence, to support custom types, it is no longer necessary to usetiny::optional_inplace(although still possible). See the readme for more information. This has been suggested in issue #3. - Breaking Change in the API of
tiny::optional_inplace: The flag manipulator's functions were renamed fromIsEmpty(),InitializeIsEmptyFlag()andPrepareIsEmptyFlagForPayload()tois_empty(),init_empty_flag()andinvalidate_empty_flag(). This was done to make the naming more consistent (since the whole public API uses snake_case names becausestd::optionaldoes). Their arguments, return values or semantics did not change.
Full Changelog: v1.0.0...v1.1.0