On Mon, 9 Mar 2009, John Peterson wrote:

> On Mon, Mar 9, 2009 at 1:03 PM, Kirk, Benjamin (JSC-EG311)
> <[email protected]> wrote:
>>
>> OMG, just derive from std::map<>, implement a proper descructor, and be done
>> with it!!! ;-)
>
> I know you are trying to get me to bite... OK it worked.

Really?  I could have sworn he was making fun of my mapvector.h, with
an offhand "who would be nuts enough to derive from std::map?" crack.
:-)

> std containers don't have virtual destructors so you can't do that!

Actually, you can - you just need to make sure that the derived class
*only* gets destructed from a pointer-to-derived, never from a
pointer-to-base.  Dangerous stuff.

(and not applicable to mapvector, I might add, which doesn't need a
special destructor)
---
Roy

------------------------------------------------------------------------------
Open Source Business Conference (OSBC), March 24-25, 2009, San Francisco, CA
-OSBC tackles the biggest issue in open source: Open Sourcing the Enterprise
-Strategies to boost innovation and cut costs with open source participation
-Receive a $600 discount off the registration fee with the source code: SFAD
http://p.sf.net/sfu/XcvMzF8H
_______________________________________________
Libmesh-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/libmesh-devel

Reply via email to