17 template <
typename Derived>
24 Derived&
derived() {
return *
static_cast<Derived*
>(
this); }
27 Derived*
p_derived() {
return static_cast<Derived*
>(
this); }
30 const Derived&
derived()
const {
return *
static_cast<const Derived*
>(
this); }
33 const Derived*
p_derived()
const {
return static_cast<const Derived*
>(
this); }
Derived * p_derived()
A pointer to the derived object.
Derived & derived()
A reference to the derived object.
const Derived & derived() const
A reference to the const derived object.
CRTP()
The default constructor.
const Derived * p_derived() const
A pointer to the const derived object.