EmptyVirtualClass Class Reference

#include <apibase.h>

Detailed Description

An empty class with a virtual destructor. This can be used for a template parameter of a class template where the parameter sets the base class of the template. This ensures that already the top-level base class has a virtual destructor, which (for usual compilers) yields a simpler class layout than a class inheritance hierarchy where derived classes introduce virtual functions at first. Example:

template <typename S> class MyTemplate : public S { ... };
class MyClass : public MyTemplate<EmptyVirtualClass>
{
public:
virtual void MyFunction();
};
S
Scale morphing.
Definition: lib_ca.h:1

Public Member Functions

 EmptyVirtualClass ()=default
 
 EmptyVirtualClass (const EmptyVirtualClass &)=default
 
 EmptyVirtualClass (EmptyVirtualClass &&)=default
 
EmptyVirtualClassoperator= (const EmptyVirtualClass &)=default
 
EmptyVirtualClassoperator= (EmptyVirtualClass &&)=default
 
virtual ~EmptyVirtualClass ()