diff --git a/modules/test/public/expects.hpp b/modules/test/public/expects.hpp index 8878092..35acc6a 100644 --- a/modules/test/public/expects.hpp +++ b/modules/test/public/expects.hpp @@ -7,9 +7,12 @@ namespace lt::test { template -concept Printable = requires(std::ostream &stream, T value) { - { stream << value } -> std::same_as; -} || requires(std::ostream &stream, T value) { +concept Formattable = requires(T &v, std::format_context ctx) { + std::formatter>().format(v, ctx); +}; + +template +concept Printable = Formattable || requires(std::ostream &stream, T value) { { stream << std::to_underlying(value) } -> std::same_as; };