You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
@vitaut suggested I think that the problem is that your operator<< is not visible in fmt/ostream.h where the formatter is specialized. You can fix this by moving the operator to a header which is included before fmt/ostream.h or use fmt/ranges.h that provides formatting support for containers and ranges.
out << addrs.front();
for (auto it = addrs.begin() + 1; it != addrs.end(); ++it) {
out << "," << *it;
}
1>C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\VC\Tools\MSVC\14.28.29910\include\ostream(746,1):
warning C4530: C++ exception handler used, but unwind semantics are not enabled. Specify /EHsc
The enable C++exception is not important, what I am concerned with is the use of the internal ostream.
The text was updated successfully, but these errors were encountered:
zcream
changed the title
Visual Studio picks up internal std::ostream despite includinf fmt/ostream.h
Visual Studio picks up internal std::ostream despite including fmt/ostream.h
May 18, 2021
operator<< must be discoverable by ADL for it to work with formatting functions. If this is not possible you can define a formatter specialization instead as explained in #2130 (comment).
I have #include <fmt/ostream.h> in my program.
Yet a compile with Visual Studio picks up the internal version of std::ostream for this code.
EDIT:- A similar problem is described here #1261
@vitaut suggested
I think that the problem is that your operator<< is not visible in fmt/ostream.h where the formatter is specialized. You can fix this by moving the operator to a header which is included before fmt/ostream.h or use fmt/ranges.h that provides formatting support for containers and ranges.
How do we manage this for classes ?
And this is how the code is being used
The enable C++exception is not important, what I am concerned with is the use of the internal ostream.
The text was updated successfully, but these errors were encountered: