Skip to content

Releases: Sedeniono/tiny-optional

v1.5.2

30 Sep 15:01

Choose a tag to compare

Fixed: The natvis file now contains the correct sentinel for pointers. The sentinel got changed in v1.5.0, but the natvis file was not adapted accordingly.

Full Changelog: v1.5.1...v1.5.2

v1.5.1

23 Sep 21:15

Choose a tag to compare

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

23 Sep 16:29

Choose a tag to compare

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 for std::optional. This means that faster code might be produced if tiny::optional is used in container-like entities such as std::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 requires clause.
    faster compile times

Full Changelog: v1.4.0...v1.5.0

v1.4.0

14 Dec 13:19

Choose a tag to compare

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

11 Jun 18:08

Choose a tag to compare

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

09 Jun 12:09

Choose a tag to compare

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 of tiny::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 in tiny/optional.h for 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

18 Apr 20:30

Choose a tag to compare

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

29 Mar 13:33

Choose a tag to compare

Major changes:

  • Added Natvis file to the include directory. 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_compressed to allow checking whether a given optional uses more memory than the payload.
  • Added tiny::is_tiny_optional_v<T> which is true if T is a tiny::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

10 Sep 12:02

Choose a tag to compare

Mainly added missing debug assert to move constructor, and explanation to the readme regarding the problems when the transition to/from the empty state happens outside of tiny::optional. Compare #4.

Full Changelog: v1.1.0...v1.1.1

v1.1.0

07 May 13:39

Choose a tag to compare

Major changes:

  • Introduced customization point tiny::optional_flag_manipulator, which allows the user to teach tiny::optional<PayloadType> about a custom "flag manipulator" for some custom type PayloadType. If available, tiny::optional<PayloadType> will always have the same size as the PayloadType. Hence, to support custom types, it is no longer necessary to use tiny::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 from IsEmpty(), InitializeIsEmptyFlag() and PrepareIsEmptyFlagForPayload() to is_empty(), init_empty_flag() and invalidate_empty_flag(). This was done to make the naming more consistent (since the whole public API uses snake_case names because std::optional does). Their arguments, return values or semantics did not change.

Full Changelog: v1.0.0...v1.1.0