P
puzzlecracker
Say we have this structure:
Struct Foo{
....
friend ostream& operator << (ostream& s, Foo & m);
.....
};
friend ostream& operator << (ostream& s, Foo & m){
//access and print
}
I had a multiple inclusion issue when I placed the definition of
operator << in .h file despite include guards. So, I eventually moved
it to Foo.cpp class.
What is the suggested design ?
Thanks
Struct Foo{
....
friend ostream& operator << (ostream& s, Foo & m);
.....
};
friend ostream& operator << (ostream& s, Foo & m){
//access and print
}
I had a multiple inclusion issue when I placed the definition of
operator << in .h file despite include guards. So, I eventually moved
it to Foo.cpp class.
What is the suggested design ?
Thanks