[ox/model] MSVC fix
This commit is contained in:
parent
c9f1b3aaa3
commit
b08559b3f3
12
deps/ox/src/ox/model/fieldcounter.hpp
vendored
12
deps/ox/src/ox/model/fieldcounter.hpp
vendored
@ -57,14 +57,20 @@ class FieldCounter {
|
|||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
namespace detail {
|
||||||
template<typename T>
|
template<typename T>
|
||||||
constexpr auto ModelFieldCount_v = [] {
|
consteval auto modelFieldCount() {
|
||||||
auto a = std::allocator<T>();
|
auto a = std::allocator<T>();
|
||||||
auto t = a.allocate(1);
|
auto t = a.allocate(1);
|
||||||
detail::FieldCounter<T> c;
|
detail::FieldCounter<T> c;
|
||||||
oxAssert(model(&c, t), "Count failed");
|
const auto err = model(&c, t);
|
||||||
|
//oxAssert(err, "Count failed");
|
||||||
a.deallocate(t, 1);
|
a.deallocate(t, 1);
|
||||||
return c.fields;
|
return c.fields;
|
||||||
}();
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
template<typename T>
|
||||||
|
constexpr auto ModelFieldCount_v = detail::modelFieldCount<T>();
|
||||||
|
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user