[ox/model] MSVC fix

This commit is contained in:
Gary Talent 2022-12-18 23:46:09 -06:00
parent c9f1b3aaa3
commit b08559b3f3

View File

@ -57,14 +57,20 @@ class FieldCounter {
}
namespace detail {
template<typename T>
constexpr auto ModelFieldCount_v = [] {
consteval auto modelFieldCount() {
auto a = std::allocator<T>();
auto t = a.allocate(1);
detail::FieldCounter<T> c;
oxAssert(model(&c, t), "Count failed");
const auto err = model(&c, t);
//oxAssert(err, "Count failed");
a.deallocate(t, 1);
return c.fields;
}();
}
}
template<typename T>
constexpr auto ModelFieldCount_v = detail::modelFieldCount<T>();
}