Description
Outcome is a C++14 library for reporting and handling function failures. It can be used as a substitute for, or a complement to, the exception handling mechanism.
One use case is for contexts where using C++ exception handling is unsuitable for different reasons:
The high relative cost of throwing and catching a C++ exception.
Making some or all control paths explicitly detailed to aid code correctness auditing, as opposed to having hidden control paths caused by exceptions potentially thrown from any place.
Company policy to compile with exceptions disabled.
Maintaining a code base that was never designed with exception-safety in mind.
Parts of the programs/frameworks that themselves implement exception handling and cannot afford to use exceptions, like propagating failure reports across threads, tasks, fibers…
outcome alternatives and similar libraries
Based on the "Miscellaneous" category.
Alternatively, view outcome alternatives based on common mentions on social networks and blogs.
-
ZXing
ZXing ("Zebra Crossing") barcode scanning library for Java, Android -
RE2
RE2 is a fast, safe, thread-friendly alternative to backtracking regular expression engines like those used in PCRE, Perl, and Python. It is a C++ library. -
ZBar
Clone of the mercurial repository http://zbar.hg.sourceforge.net:8000/hgroot/zbar/zbar -
American fuzzy lop
american fuzzy lop - a security-oriented fuzzer -
Serial Communication Library
Cross-platform, Serial Port library written in C++ -
Better Enums
C++ compile-time enum to string, iteration, in a single header file -
c-smart-pointers
Smart pointers for the (GNU) C programming language -
Experimental Boost.DI
DI: C++14 Dependency Injection Library -
UNITS
a compile-time, header-only, dimensional analysis and unit conversion library built on c++14 with no dependencies. -
constexpr-8cc
Compile-time C Compiler implemented as C++14 constant expressions -
cxx-prettyprint
A header-only library for C++(0x) that allows automagic pretty-printing of any container. -
libcpuid
a small C library for x86 CPU detection and feature extraction -
value-category-cheatsheet
A C++14 cheat-sheet on lvalues, rvalues, xvalues, and more -
StrTk
C++ String Toolkit Library https://www.partow.net/programming/strtk/index.html -
ub-canaries
collection of C/C++ programs that try to get compilers to exploit undefined behavior -
QtVerbalExpressions
This Qt lib is based off of the C++ VerbalExpressions library. [MIT] -
access_profiler
a tool to count accesses to member variables in c++ programs
Write Clean C++ Code. Always.
* Code Quality Rankings and insights are calculated and provided by Lumnify.
They vary from L1 to L5 with "L5" being the highest.
Do you think we are missing an alternative of outcome or a related project?
README
master branchdevelop branch
CTest dashboard: https://my.cdash.org/index.php?project=Boost.Outcome
All tests passing source tarballs: https://github.com/ned14/outcome/releases
Documentation: https://ned14.github.io/outcome/
Purpose of this library
Outcome is a C++14 library for reporting and handling function failures. It can be used as a substitute for, or a complement to, the exception handling mechanism.
One use case is for contexts where using C++ exception handling is unsuitable for different reasons:
- The high relative cost of throwing and catching a C++ exception.
- Making some or all control paths explicitly detailed to aid code correctness auditing, as opposed to having hidden control paths caused by exceptions potentially thrown from any place.
- Company policy to compile with exceptions disabled.
- Maintaining a code base that was never designed with exception-safety in mind.
- Parts of the programs/frameworks that themselves implement exception handling and cannot afford to use exceptions, like propagating failure reports across threads, tasks, fibers…
Usage as a single header file
Outcome v2 comes in single header file form. This is regenerated per commit. To fetch on Linux:
wget https://github.com/ned14/outcome/raw/master/single-header/outcome.hpp
On BSD:
fetch https://github.com/ned14/outcome/raw/master/single-header/outcome.hpp
If you have curl
installed:
curl -O -J -L https://github.com/ned14/outcome/raw/master/single-header/outcome.hpp
Otherwise, simply download the raw file from above and place it wherever it suits you. If you might be debugging using Microsoft Visual Studio, you may find the debugger visualisation file at https://github.com/ned14/outcome/raw/master/include/outcome/outcome.natvis useful to include into your build.
Commits and tags in this git repository can be verified using:
-----BEGIN PGP PUBLIC KEY BLOCK----- Version: GnuPG v2
mDMEVvMacRYJKwYBBAHaRw8BAQdAp+Qn6djfxWQYtAEvDmv4feVmGALEQH/pYpBC llaXNQe0WE5pYWxsIERvdWdsYXMgKHMgW3VuZGVyc2NvcmVdIHNvdXJjZWZvcmdl IHthdH0gbmVkcHJvZCBbZG90XSBjb20pIDxzcGFtdHJhcEBuZWRwcm9kLmNvbT6I eQQTFggAIQUCVvMacQIbAwULCQgHAgYVCAkKCwIEFgIDAQIeAQIXgAAKCRCELDV4 Zvkgx4vwAP9gxeQUsp7ARMFGxfbR0xPf6fRbH+miMUg2e7rYNuHtLQD9EUoR32We V8SjvX4r/deKniWctvCi5JccgfUwXkVzFAk= =puFk -----END PGP PUBLIC KEY BLOCK-----