Tiny Optional Versions Save

Replacement for std::optional that does not waste memory unnecessarily

v1.2.1

1 month ago

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: https://github.com/Sedeniono/tiny-optional/compare/v1.2.0...v1.2.1

v1.2.0

2 months ago

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: https://github.com/Sedeniono/tiny-optional/compare/v1.1.1...v1.2.0

v1.1.1

8 months ago

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: https://github.com/Sedeniono/tiny-optional/compare/v1.1.0...v1.1.1

v1.1.0

1 year ago

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: https://github.com/Sedeniono/tiny-optional/compare/v1.0.0...v1.1.0

v1.0.0

1 year ago

First stable release.