Search Results

Search found 1 results on 1 pages for 'mutmansky'.

Page 1/1 | 1 

  • Will the template argument's destructor to a templated class be called on deletion?

    - by Mutmansky
    If you have a templated base class as in the following example: class A{ A(); virtual ~A(); }; template <class T> class B : public T { B(); virtual ~B(); }; typedef B<A> C; class D : public C { D(); virtual ~D(); }; When you delete an instance of D, will the destructor of A be called? I'll probably create a test program to find out what happens, but just thinking about it, I wasn't sure what should happen.

    Read the article

1