BLI: Add utility method to check if CPPType matches multiple types

This commit is contained in:
Jacques Lucke
2023-04-28 10:16:36 -04:00
committed by Hans Goudey
parent 67700ced54
commit ac1827edda

View File

@@ -705,6 +705,11 @@ class CPPType : NonCopyable, NonMovable {
return this == &CPPType::get<std::decay_t<T>>();
}
template<typename... T> bool is_any() const
{
return (this->is<T>() || ...);
}
/**
* Convert a #CPPType that is only known at run-time, to a static type that is known at
* compile-time. This allows the compiler to optimize a function for specific types, while all