19-02-2026, 01:33 PM
Hi,
We are having a discussion internally about how to interpret rule 15.1.2. In particular, the rule exception says that a class is considered empty "when it has [...], no virtual member functions, [...]".
The question is whether a virtual (defaulted) destructor is considered a virtual member function in this context. For example, whether the following class is considered empty or not for the sake of this rule:
My personal interpretation is that this class is not considered empty (it will contain the v-table), so it does not qualify as an exception w.r.t. rule 15.2 when used as a base class. Can you confirm that this interpretation is correct?
Thank you very much and best regards,
Daniel "Merge" Merget
We are having a discussion internally about how to interpret rule 15.1.2. In particular, the rule exception says that a class is considered empty "when it has [...], no virtual member functions, [...]".
The question is whether a virtual (defaulted) destructor is considered a virtual member function in this context. For example, whether the following class is considered empty or not for the sake of this rule:
Code:
struct Base () {
virtual ~Base() = default;
};My personal interpretation is that this class is not considered empty (it will contain the v-table), so it does not qualify as an exception w.r.t. rule 15.2 when used as a base class. Can you confirm that this interpretation is correct?
Thank you very much and best regards,
Daniel "Merge" Merget

