1 changed files with 25 additions and 0 deletions
			
			
		@ -0,0 +1,25 @@
					 | 
				
			||||
/*
 | 
				
			||||
 * Copyright (C) 2023 Riyyi | 
				
			||||
 * | 
				
			||||
 * SPDX-License-Identifier: MIT | 
				
			||||
 */ | 
				
			||||
 | 
				
			||||
#pragma once | 
				
			||||
 | 
				
			||||
#include <typeinfo> | 
				
			||||
 | 
				
			||||
template<typename T, typename U> | 
				
			||||
inline bool is(U& input) | 
				
			||||
{ | 
				
			||||
	if constexpr (requires { input.template fastIs<T>(); }) { | 
				
			||||
		return input.template fastIs<T>(); | 
				
			||||
	} | 
				
			||||
 | 
				
			||||
	return typeid(input) == typeid(T); | 
				
			||||
} | 
				
			||||
 | 
				
			||||
template<typename T, typename U> | 
				
			||||
inline bool is(U* input) | 
				
			||||
{ | 
				
			||||
	return input && is<T>(*input); | 
				
			||||
} | 
				
			||||
					Loading…
					
					
				
		Reference in new issue