On 11/05/2014 10:07 AM, Ali Çehreli wrote:

> On 11/05/2014 09:17 AM, Patrick Jeeves wrote:
>
>  > class foo
>  > {
>  > static std::list<foo*> foo_list;
>  > typedef std::list<foo*>::iterator iterator;
>  > public:
>  >      foo()
>  >      {
>  >         foo_list.push_back(this);
>  >      }

Argh! I forgot to add an important, perhaps philosophical, point. :) Continuing the off-topic, an object should be considered constructed only after hitting that closing curly bracket above. If so, then that push_back would be adding an incomplete object to the list.

Ali

Reply via email to