Skip to content

Releases: ttheghost/result.hpp

Release v1.3.0: Enhanced Debuggability & Chaining

Choose a tag to compare

@ttheghost ttheghost released this 13 Nov 00:05

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 an Ok value, run a function with it (e.g., for logging), and then pass the original Result object on. It is ignored if the Result is an Err.
  • inspect_err(fn): This method does the same, but for Err values. It allows you to inspect, log, or perform a side-effect on an error without consuming it. It is ignored if the Result is Ok.

Improvements

  • Internal implementation of map_err has been refactored for improved robustness (non-breaking change).

Release v1.2.0: Support for Identical Ok and Error Types

Choose a tag to compare

@ttheghost ttheghost released this 12 Nov 20:11

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: The Result class 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 == E use case.

Release v1.1.1: Fixing MSVC Compatibility with C++20 Detection

Choose a tag to compare

@ttheghost ttheghost released this 12 Nov 16:23

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

Choose a tag to compare

@ttheghost ttheghost released this 12 Nov 15:55
9f387fa

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

Choose a tag to compare

@ttheghost ttheghost released this 11 Nov 20:10
1a54421
v1.0.0

Add CodeQL static scanner