#1136·doctest

Support for fmtlib & std::format

Author: jollie-finCreated May 27, 2026Updated May 27, 2026

Description

Allowing use of std::formatter (or fmt::formatter) with default format, for printing.

This opens using doctest without having to duplicate logging function and do UB

This is related to !843, so it is a form of issue reopening, but this times it comes with a PR :)

( https://github.com/jollie-fin/doctest/tree/formatter )

Workarounds

No response

Context

We have a significant codebase relying on doctest for testing.

We are slowly switching from operator<< to std::formatter, and it would be lovely to be able to automatically log them on assertion with default formatting string.

It would avoid having to duplicate stringification just for doctest.

I do know about !843 , but since I have worked on a solution, I thought I would open a new issue.