drogon/tests/ClassNameTest.cc

27 lines
476 B
C++
Raw Normal View History

2018-08-08 09:58:43 +00:00
#include <drogon/DrObject.h>
#include <iostream>
2018-10-14 07:56:54 +00:00
namespace api
{
namespace v1
{
template <typename T>
class handler : public drogon::DrObject<T>
{
public:
static void p()
{
std::cout << handler<T>::classTypeName() << std::endl;
2018-08-08 09:58:43 +00:00
}
2018-10-14 07:56:54 +00:00
};
class hh : public handler<hh>
{
};
} // namespace v1
} // namespace api
2018-08-08 09:58:43 +00:00
int main()
{
api::v1::hh h;
2018-10-14 07:56:54 +00:00
std::cout << h.className() << std::endl;
std::cout << api::v1::hh::classTypeName() << std::endl;
2018-08-08 09:58:43 +00:00
h.p();
}