Glossary: Coding Interviews in C++
std::optional
Also written: optional, std::nullopt, nullopt
C++'s "maybe a value": it holds a value or is empty (`std::nullopt`). Test it in an `if` and read it with `*` or `->`.
Glossary: Coding Interviews in C++
Also written: optional, std::nullopt, nullopt
C++'s "maybe a value": it holds a value or is empty (`std::nullopt`). Test it in an `if` and read it with `*` or `->`.