[Solved] *this emulation in standalone functions [closed]
[ad_1] Here’s a possible solution: Use the same name, just at different scopes. #include <iostream> #define LOG(x) do { log() << (x) << ‘\n’; } while(false) std::ostream & log() { return std::clog; } struct Identifier { std::ostream & log() { return ::log() << id << “: “; } int id; explicit Identifier(int n) : id(n) … Read more