A very simple C++ header only library which helps to avoid exceptions by providing return wrapper types capable of holding either the return value or an error value.
This library provides a decent mechanism for error reporting in the absence of exceptions (e.g. a project uses the -fno-exceptions flag) via return values. The intention is to avoid additional function arguments which are normally used in such scenarious and encapsulate them into a single return value.
Simply run:
# make install
As this is a header only library you don't have to compile anything for this to work. Also if you want to use the library you just need to include the header files in your sources - no library linking required.
Use # make uninstall if you want to remove the files from your system.
The library disables safety checks if the preprocessor directive "NDEBUG" is specified. This can introduce undefined behaviour if you call .take() serveral times on the same object. Also you are always supposed to check with .ok() if an value is present before .take() ing it.
The file src/test/main.cpp provides a lot of examples which should give the user a good overview how the two provided classes can be used. The examples can be run by calling $ make.