boost::optional: unleash the power of C++ with Boost libraries.
Boost.Optional class is very close the boost::variant class but for only one type. boost::optional holds an array of char, where the object of type T can be an in-place constuctor. It has also a boolean flag to remember the state of the object (if is constructed or not).
To use this class, just add #include <boost/optional.hpp> to your program. See the example below:
Boost.Optional class does not use dinamic allocation, and it does not require a default constructor for the underlying type.
##Further Information
Advantages of using the C++ Boost Libraries
Boost C++ Application Development Cookbook, by Antony Polukhin