fmtlib support
- Dominant language
- C++
- Stars
- 21.5k
- Forks
- 3.5k
- Avg merge
- 3d 16h
- Merged PRs (30d)
- 2
Description
**Description**
We have a codebase whose data structures can be printed via custom [fmtlib](https://github.com/fmtlib/fmt) formatters. It'd be great if Catch could detect these formatters automatically and use them.
**Additional context**
I've started experimenting with introducing this into your codebase - but wanted to check if it's even a desired feature of catch2 before proceeding:
Naively, the easiest approach to this would be to copy what's done for `operator<<` in catch_tostring.hpp - in addition to [IsStreamInsertable] (https://github.com/catchorg/Catch2/blob/53d0d913a422d356b23dd927547febdf69ee9081/src/catch2/catch_tostring.hpp#L68) used for streaming, we offer a "IsFmtFormattable" that calls [fmt::is_formattable](https://github.com/fmtlib/fmt/blob/274ba2645bdae12f6f0c7d7ca24659c4af670548/include/fmt/core.h#L1780) to see if something can be printed via fmtlib.
We could hook into `__has_include` to see if fmtlib is even present, and if not, `ifdef` all that stuff out.
Contributor guide
Assessment
This issue has not been assessed yet.