boost/libs/optional
2021-10-05 21:37:46 +02:00
..
doc [DEV] add v1.76.0 2021-10-05 21:37:46 +02:00
meta [DEV] add v1.76.0 2021-10-05 21:37:46 +02:00
test [DEV] add v1.76.0 2021-10-05 21:37:46 +02:00
CMakeLists.txt [DEV] add v1.76.0 2021-10-05 21:37:46 +02:00
index.html [DEV] add v1.66.0 2018-01-12 21:47:58 +01:00
README.md [DEV] add v1.66.0 2018-01-12 21:47:58 +01:00

optional

A library for representing optional (nullable) objects in C++.

optional<int> readInt(); // this function may return either an int or a not-an-int

if (optional<int> oi = readInt()) // did I get a real int
  cout << "my int is: " << *oi;   // use my int
else
  cout << "I have no int";

For more information refer to the documentation provided with this library.