
AMDG joel falcou wrote:
Scott Banachowski wrote:
By defeating the purpose, I mean it forces code like the following:
if( ut_detail::test_id_2_unit_type( tu.second->p_id ) == tut_suite ) delete static_cast
(tu.second); else delete static_cast (tu.second); A virtual base case simplifies this code (especially if in the future other classes are added, or in the case of replacement allocator it does the right thing).
I'm jumping in the wagon but this very piece of code leads to a "incorrect free" on Snow Leopard using g++ 4.2.1 Apple. Maybe it is related to the virtual matter
We've already discussed this many times. The code above is wrong for reasons unrelated to the use of a virtual destructor, although adding a virtual destructor masks the problem. This has been fixed in the trunk. In Christ, Steven Watanabe