Open
Description
A Maybe is a container like vector but has either 0 or 1 element.
This would be convenient:
for(auto x : maybe(1) ) {
std::cout << x << std::endl; // prints 1
}
for(auto x : maybe<int>() ) {
//loop not entered
}
Functional maps should never have sideeffects. For sideeffects this way should be preferred.
Activity