[ox/model] Add requireModelTypeName
This commit is contained in:
parent
eef1bfcbd6
commit
7aead742eb
7
deps/ox/src/ox/model/typenamecatcher.hpp
vendored
7
deps/ox/src/ox/model/typenamecatcher.hpp
vendored
@ -61,6 +61,13 @@ constexpr Str getModelTypeName(T *val) noexcept {
|
||||
return nc.name;
|
||||
}
|
||||
|
||||
template<typename T>
|
||||
consteval auto requireModelTypeName() noexcept {
|
||||
constexpr auto name = getModelTypeName<T>();
|
||||
static_assert(ox_strcmp(name, "") != 0, "TypeName is required");
|
||||
return name;
|
||||
}
|
||||
|
||||
template<typename T, typename Str = const char*>
|
||||
constexpr auto ModelTypeName_v = getModelTypeName<T, Str>();
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user