Context
The core API (context layers, fmt, macros, Expected) is done on C++20. This issue tracks backporting to C++17 so the library is usable without requiring C++20. The public API stays identical across tiers.
Changes required
Frame / source_location
- Macro fallback
ANYHOW_HERE using __FILE__ / __LINE__ / __func__
source_location path guarded behind #if __cplusplus >= 202002L
ANYHOW_TRY* macros use ANYHOW_HERE internally; C++20 resolves to std::source_location::current()
fail_with() uses the same source_location default argument; same fallback applies
Ranges
std::views::reverse(context) in Failure::fmt() and Failure::chain() replaced with a manual reverse loop under #if __cplusplus < 202002L
CI
Add -std=c++17 to the build matrix on GCC + Clang.
Context
The core API (
contextlayers,fmt,macros, Expected) is done on C++20. This issue tracks backporting to C++17 so the library is usable without requiring C++20. The public API stays identical across tiers.Changes required
Frame / source_location
ANYHOW_HEREusing__FILE__/__LINE__/__func__source_locationpath guarded behind#if __cplusplus >= 202002LANYHOW_TRY*macros useANYHOW_HEREinternally; C++20 resolves tostd::source_location::current()fail_with()uses the samesource_locationdefault argument; same fallback appliesRanges
std::views::reverse(context)inFailure::fmt()andFailure::chain()replaced with a manual reverse loop under#if __cplusplus < 202002LCI
Add
-std=c++17to the build matrix on GCC + Clang.