Jean-Marc Lasgouttes <[EMAIL PROTECTED]> writes: | Jean-Marc Lasgouttes wrote: | > John Levon wrote: | > | >> A subtle thing I found out a few weeks ago. You need to have an out of | >> line dtor for the object that has a scoped_ptr inside it. e.g. | >> XMiniBuffer needs an outofline dtor because it contains a scoped_ptr as | >> a member on a forward-declared class | > The kind of things I cqnnot guess by myself. Thansk. | | Hmm, I take my Thansk back. It did not work. Anyway my time is up | for this evening. | | What I wanted to do is to add a Menu (or Menu*) member to MenuItem, so | that Menu::expand can create an actual submenu for items of kind | Submenu. This is needed to move toc support to menubackend.
Think: what is the scope of objects inside a stl::container? Does any copyinbg occur? Then think about what a scoped_ptr is. Now realize that you have to use a shared_ptr instead. -- Lgb