When should you not use virtual destructors?
问题 Is there ever a good reason to not declare a virtual destructor for a class? When should you specifically avoid writing one? 回答1: There is no need to use a virtual destructor when any of the below is true: No intention to derive classes from it No instantiation on the heap No intention to store in a pointer of a superclass No specific reason to avoid it unless you are really so pressed for memory. 回答2: To answer the question explicitly, i.e. when should you not declare a virtual destructor. C