-
Notifications
You must be signed in to change notification settings - Fork 287
Closed
Labels
bugSomething isn't workingSomething isn't working
Description
The following two lines cause link error (using Visual Studio + mingw64 or remote ubuntu g++12) because of multiple defined symbols :
std::ostream& (&endl)(std::ostream&) = static_cast<std::ostream& (&)(std::ostream&)>(std::endl);
std::ostream& (&flush)(std::ostream&) = static_cast<std::ostream& (&)(std::ostream&)>(std::flush);
Direct compilation (ubuntu g++ or msvc) don't trigger linker problems.
However, changing these lines to
inline static std::ostream& (&endl)(std::ostream&) = static_cast<std::ostream& (&)(std::ostream&)>(std::endl);
inline static std::ostream& (&flush)(std::ostream&) = static_cast<std::ostream& (&)(std::ostream&)>(std::flush);
seems more correct, don't hurt already working builds, and fixes the linking error.
Metadata
Metadata
Assignees
Labels
bugSomething isn't workingSomething isn't working