Replacement for std::optional that does not waste memory unnecessarily
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
Major changes:
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.tiny::optional::is_compressed
to allow checking whether a given optional uses more memory than the payload.tiny::is_tiny_optional_v<T>
which is true if T
is a tiny::optional
(or some other optional defined by this library).Full Changelog: https://github.com/Sedeniono/tiny-optional/compare/v1.1.1...v1.2.0
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
Major changes:
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.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
First stable release.