#include <stlsoft/util/constraints.hpp>
D | The derived type | |
B | The base type |
class Parent {}; class Child : public Parent {}; class Orphan {}; stlsoft::must_have_base<Parent, Parent>(); // Ok stlsoft::must_have_base<Child, Parent>(); // Ok stlsoft::must_have_base<Child, Child>(); // Ok stlsoft::must_have_base<Child, Parent>(); // Compile error! stlsoft::must_have_base<Orphan, Parent>(); // Compile error! stlsoft::must_have_base<Orphan, Child>(); // Compile error! stlsoft::must_have_base<Parent, Orphan>(); // Compile error! stlsoft::must_have_base<Child, Orphan>(); // Compile error!