gieseanw / optional

Boost.org optional module

Home Page:http://boost.org/libs/optional

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

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.

About

Boost.org optional module

http://boost.org/libs/optional


Languages

Language:C++ 99.6%Language:CMake 0.3%Language:HTML 0.2%