Use the derived_from concept in the template of the IS(X) macro

This commit is contained in:
Username404-59 2021-10-20 13:16:54 +02:00
parent ec2af24be3
commit d9b399881d
Signed by: Username404-59
GPG Key ID: 7AB361FBB257A5D1
1 changed files with 2 additions and 1 deletions

View File

@ -13,7 +13,8 @@ using namespace std;
#include "../lex.hpp"
#define IS(X) template<typename T = X, typename std::enable_if<std::is_base_of<X, T>::value>::type* = nullptr>
#include <concepts>
#define IS(X) template<derived_from<X> T = X>
struct ParseComponent {
[[nodiscard]] constexpr const type_info& getId() const { return typeid(*this); }
virtual ~ParseComponent() = default;