Skip to content

C++17 compatibility tier #4

Description

@MihaiStreames

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    compatC++17/20 compatibility, portability

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions