J
Jon Slaughter
I made a simple container that contains an STL container(basicaly a wrapper)
and I want to use for each on it just like I would with an STL container.
How do I make my container STL complient so I can do something like the
following:
class Container
{
private:
vector<int> V;
public:
.........
};
void main()
{
for each (int i in Container)
{
*******************
};
return;
};
Any ideas? I'm looking for a very simple(less code) method to access the
elements of my container without using an iterator and this is as close as I
have seen since its works very very nice for STL containers... now if I
could easily make it work for mine.
Thanks,
Jon
and I want to use for each on it just like I would with an STL container.
How do I make my container STL complient so I can do something like the
following:
class Container
{
private:
vector<int> V;
public:
.........
};
void main()
{
for each (int i in Container)
{
*******************
};
return;
};
Any ideas? I'm looking for a very simple(less code) method to access the
elements of my container without using an iterator and this is as close as I
have seen since its works very very nice for STL containers... now if I
could easily make it work for mine.
Thanks,
Jon