Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- class A {
- friend std::ostream& operator<<(std::ostream &os, A &a);
- };
- A a() {
- return A{};
- }
- int main() {
- std::cout << a(); // error!
- //A aa = a(); std::cout << aa; // compiles just fine
- }
- error: no match for ‘operator<<’ (operand types are ‘std::ostream {aka std::basic_ostream<char>}’ and ‘A’)
- std::cout << a();
- ^
- ...200 (!) more lines of stderr...
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement