Repository navigation
Releases: ttheghost/result.hpp
Releases · ttheghost/result.hpp
Release list
Release v1.3.0: Enhanced Debuggability & Chaining
This release introduces new utility functions for debugging and logging without breaking existing chains of operations.
New Features
inspect(fn): This method allows you to "peek" at anOkvalue, run a function with it (e.g., for logging), and then pass the originalResultobject on. It is ignored if theResultis anErr.inspect_err(fn): This method does the same, but forErrvalues. It allows you to inspect, log, or perform a side-effect on an error without consuming it. It is ignored if theResultisOk.
Improvements
- Internal implementation of
map_errhas been refactored for improved robustness (non-breaking change).
Release v1.2.0: Support for Identical Ok and Error Types
This release introduces an improvement to the Result class, enabling support for cases where the Ok and Err types are identical (e.g., Result<int, int>). This was achieved by refactoring the internal storage, which also resolved several related bugs.
Features
- Support for
T == E: TheResultclass now fully supports instantiations where the success and error types are the same.
Testing
- Added new Google Tests to specifically validate and cover the
T == Euse case.
Release v1.1.1: Fixing MSVC Compatibility with C++20 Detection
This patch release fixes a compilation issue on MSVC caused by the C++20 feature detection macro.
Details:
- Updated the feature detection preprocessor guard:
#if _MSC_VER
#include <yvals.h>
#endif
#if __cplusplus >= 202002L || _HAS_CXX20- Ensures the library builds correctly on MSVC while maintaining compatibility with GCC and Clang.
- No behavioral or API changes.
Release v1.1.0: Generic Error Types (E) & match() Support
v1.1.0 makes Result fully generic, supporting Result<T, E> for any error type, not just the default Error. This release also adds the new .match() method for exhaustive Ok/Err handling and fixes several value-category and move-semantic bugs.
The first release of Result
v1.0.0 Add CodeQL static scanner