How to know if a std::list has been modified

Posted by Nick on Stack Overflow See other posts from Stack Overflow or by Nick
Published on 2012-07-07T07:53:30Z Indexed on 2012/07/07 9:16 UTC
Read the original article Hit count: 261

Filed under:
|

I have this class:

class C
{
public:

    C* parent;
    std::list<C> children;
};

I can use this class in this way for example:

C root;
C child;

root.children.push_back(child); // or other method of std::list (es: push_front, insert, ...)

// Here child.parent is root
// How can I set the parent of child?

I want to do this work internally to my class without losing the functionality of std::list, is it possible?

© Stack Overflow or respective owner

Related posts about c++

Related posts about list