#pragma once // a helper class for implementing static casting to a derived class using the // curiously recurring template pattern template struct Crtp { Derived& derived() { return *static_cast(this); } const Derived& derived() const { return *static_cast(this); } };