fmtlib / fmt

A modern formatting library
https://fmt.dev
Other
19.9k stars 2.43k forks source link

Cannot use ostream support on fmt 9.x and 10.x #3922

Closed ahoarau closed 3 months ago

ahoarau commented 3 months ago

Hello ! I'm having compile issues on fmt 9.x and 10.x with the ostream extension. Same on msvc (latest) and gcc 13.2 : https://godbolt.org/z/8oejx8Yfn Thanks for the help !

#include <fmt/ostream.h>

struct A{};

std::ostream& operator<<(std::ostream& os, const A& a)
{
    os << "Hello !";
    return os;
}

int main()
{
    fmt::print("{}", A{});
}

7.x => ✅

image

8.x => ✅

image

9.x => ❌

image

10.x => ❌

image

vitaut commented 3 months ago

Duplicate of #3318.