From b08559b3f3bcc50e36ceb297af8644ed3e11cce6 Mon Sep 17 00:00:00 2001 From: Gary Talent Date: Sun, 18 Dec 2022 23:46:09 -0600 Subject: [PATCH] [ox/model] MSVC fix --- deps/ox/src/ox/model/fieldcounter.hpp | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/deps/ox/src/ox/model/fieldcounter.hpp b/deps/ox/src/ox/model/fieldcounter.hpp index d65af665..38142cdd 100644 --- a/deps/ox/src/ox/model/fieldcounter.hpp +++ b/deps/ox/src/ox/model/fieldcounter.hpp @@ -57,14 +57,20 @@ class FieldCounter { } +namespace detail { template -constexpr auto ModelFieldCount_v = [] { +consteval auto modelFieldCount() { auto a = std::allocator(); auto t = a.allocate(1); detail::FieldCounter 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 +constexpr auto ModelFieldCount_v = detail::modelFieldCount(); }