memgraph/utils/crtp.hpp
2015-08-30 01:12:46 +02:00

17 lines
315 B
C++

#ifndef MEMGRAPH_UTILS_CRTP_HPP
#define MEMGRAPH_UTILS_CRTP_HPP
// a helper class for implementing static casting to a derived class using the
// curiously recurring template pattern
template <class Derived>
struct Crtp
{
Derived& derived()
{
return *static_cast<Derived*>(this);
}
};
#endif