LoopPerfect / neither

Either and Maybe monads for better error-handling in C++ ↔️
MIT License
249 stars 18 forks source link

Maybe: Add static const object none #20

Closed rvarago closed 5 years ago

rvarago commented 5 years ago

That is an instance of type Maybe, used to represent the absence of a value.

Additionally, added support for operator== and operator!= for Maybe, hence none, with the semantics:

Maybe<void> x;
Maybe<void> y;

x == y => true
x != y => false

Given that it doesn't hold a value. Therefore, none will be always equal to itself.