VIPRA Documentation
Loading...
Searching...
No Matches
crtp.hpp
1#pragma once
2
3namespace VIPRA::Util {
4
5template <typename class_t>
6class CRTP;
7
8template <template <typename> class class_t, class derived_t>
9class CRTP<class_t<derived_t>> {
10 public:
11 constexpr auto self() -> derived_t& { return static_cast<derived_t&>(*this); }
12 constexpr auto self() const -> derived_t const&
13 {
14 return static_cast<derived_t const&>(*this);
15 }
16};
17
18} // namespace VIPRA::Util
Definition crtp.hpp:6