だから私はこのコードを自分で書いていますが、他のサンプルコードから取っています...
class A{
friend std::ostream& operator<< (std::ostream& out, A& a);
// Constructors, destructor, and variables have been declared
// and initialized and all good.
}
std::ostream& operator<< (std::ostream& out, A& a){
out << " this gets written " << endl; // it doesn't get executed
return out;
}
int main(){
A *_a = new A();
return 0;
}
まあ、これはコンソールに印刷されていないだけです" this gets written "