Hi,
I am trying to reduce the complexity of a set of classes I made a couple of
years ago, what equates to a set of trees, for which I want to use std::list
and avoid having to use direct pointers anywhere.
I wish to have a class contain a list of itself, as so:
class B;
class A
{
public:
std::list<B> List;
typedef std::list<B>::iterator iterator;
iterator begin() { return List.begin(); }
};
class B
{
public:
A m_a;
};
My question is, provided I ensure there is no in class A referencing direct
instances of B, can I be fairly certain im not launching into a world of c++
driven pain, for example no:
class A
{
...
B GetSomething();
};
I expect that as long as thing that call items such as copy constructors
or -> / * operators of list<B>::iterator are in cpp files there should be no
issue.
Could anyone tell me different?
Regards,
--
- Mark Randall
http://www.temporal-solutions.co.uk
http://www.awportals.com