loop list<> inside &operator<<

Please forgive me. Beginner here. I've done the appropriate research and just haven't found anything.


Here's how I have my current stripped down set up in pseudo code:

1
2
3
4
5
6
7
8
9
class Foo{
int fooValue = 0;
&operator<<(out, foo){print a foo};
}

class FooContainer{
vector<foo> myFooList;
vector<foo> getFooList(){return myFooList;};
}



I've been told that the standard form for overloading << is
friend ostream &operator<<( ostream &out, const FooContainer &FC );


how do I take a const FooContainer &FC and loop through the FooList to print out all the FooValues?

In my noob java brainwashed head, I want to do FC.getFooList().iterator() but I've experimented quite a bit with this approach and I'm totally lost.

///sorry, make that a vector
Last edited on
Topic archived. No new replies allowed.