This is an older version of Boost and was released in 2014. The current version is 1.87.0.
C++
03
Added in Boost
1.30.0
Categories:
Data
Discriminated-union wrapper for optional values.
This Release
Dependencies
Assert
Config
Core
Detail
Move
MPL
Static Assert
ThrowException
Type Traits
Utility
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.