Skip to content

Commit 165eb47

Browse files
committed
Updated readme.
1 parent 2d2af13 commit 165eb47

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

README.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -827,5 +827,10 @@ The [discussion on reddit](https://www.reddit.com/r/cpp/comments/ybc4lf/tinyopti
827827
* [LibCat](https://github.com/Cons-Cat/libCat/blob/main/src/libraries/optional/cat/optional): A C++20 library that includes a similar optional where you can specify a lambda as non-type template parameter that handles the sentinel. It seems to be conceptionally similar to `tiny::optional_inplace` described above.
828828
* [foonathan/tiny](https://github.com/foonathan/tiny): Seems to be abandoned and to not implement a fully fledged `std::optional` replacement.
829829

830+
Moreover, a few years after the initial release of `tiny::optional`, the [`opt::option`](https://github.com/NUCLEAR-BOMB/option) library has been published (discussion on [reddit](https://www.reddit.com/r/cpp/comments/1fgjhvu/optoption_a_replacement_for_stdoptional/?utm_source=share&utm_medium=web3x&utm_name=web3xcss&utm_term=1&utm_content=share_button)).
831+
It shares one of the motivations for `tiny::optional`, namely to not waste memory unnecessarily. It supports more types out-of-the-box than `tiny::optional`, where the empty state is stored in-place.
832+
In contrast, `tiny::optional` also has the sentinel use-case as motivation (`tiny::optional<int, -1>`).
833+
I have not studied `opt::option` in detail, nor have I seen any compile-time or runtime benchmarks on how the two libraries compare.
834+
830835

831836
Also, Rust's `Option` implements some magic for [references](https://stackoverflow.com/q/16504643/3740047) and [bools](https://stackoverflow.com/q/73180983/3740047).

0 commit comments

Comments
 (0)