mirror of
https://github.com/TartanLlama/optional.git
synced 2025-06-25 00:51:37 +02:00
Update README.md
This commit is contained in:
@ -1,8 +1,10 @@
|
||||
# optional
|
||||
|
||||
Single header implementation of `std::optional` with functional-style extensions and support for references.
|
||||
|
||||
Clang + GCC: [](https://travis-ci.org/TartanLlama/optional)
|
||||
MSVC: [](https://ci.appveyor.com/project/TartanLlama/optional)
|
||||
[](https://tl.tartanllama.xyz/en/latest/?badge=latest)
|
||||
|
||||
`std::optional` is the preferred way to represent an object which may or may not have a value. Unfortunately, chaining together many computations which may or may not produce a value can be verbose, as empty-checking code will be mixed in with the actual programming logic. This implementation provides a number of utilities to make coding with `optional` cleaner.
|
||||
|
||||
@ -41,8 +43,6 @@ tl::optional<image> get_cute_cat (const image& img) {
|
||||
}
|
||||
```
|
||||
|
||||
Full documentation available at [tl.tartanllama.xyz](https://tl.tartanllama.xyz)
|
||||
|
||||
The interface is the same as `std::optional`, but the following member functions are also defined. Explicit types are for clarity.
|
||||
|
||||
- `map`: carries out some operation on the stored object if there is one.
|
||||
|
Reference in New Issue
Block a user