libcaramel
crtp.hpp
1 #pragma once
2 
3 namespace caramel
4 {
5  template <typename any_, template <typename> class crtp_type_>
6  struct crtp
7  {
8  constexpr auto underlying() -> any_& { return static_cast<any_&>(*this); }
9  constexpr auto underlying() const -> any_ const& { return static_cast<any_ const&>(*this); }
10  };
11 } // namespace caramel
Definition: crtp.hpp:7