Core/OffsetOf: Remove constexpr (cannot be used because of reinterpret_cast)

Former-commit-id: 78142eb9033a1969f20055b2cecf1bc78152e896
This commit is contained in:
Lynix 2015-06-17 23:32:48 +02:00
parent e89b87044d
commit 80208b0dc5
3 changed files with 2 additions and 5 deletions

View File

@ -14,8 +14,9 @@ template <typename T, typename M> T NzImplGetClassType(M T::*);
template <typename T, typename M> M NzImplGetMemberType(M T::*);
template <typename T, typename R, R T::*M>
constexpr std::size_t NzImplOffsetOf()
std::size_t NzImplOffsetOf()
{
///FIXME: reinterpret_cast is not allowed in constexpr functions
return reinterpret_cast<std::size_t>(&((static_cast<T*>(0))->*M));
}

View File

@ -31,8 +31,6 @@ namespace
NzVector2f uv;
};
static_assert(NzOffsetOf(BillboardPoint, sinCos) - NzOffsetOf(BillboardPoint, size) == sizeof(NzVector2f), "size and sinCos members should be packed");
unsigned int s_maxQuads = std::numeric_limits<nzUInt16>::max()/6;
unsigned int s_vertexBufferSize = 4*1024*1024; // 4 MiB
}

View File

@ -31,8 +31,6 @@ namespace
NzVector2f uv;
};
static_assert(NzOffsetOf(BillboardPoint, sinCos) - NzOffsetOf(BillboardPoint, size) == sizeof(NzVector2f), "size and sinCos members should be packed");
unsigned int s_maxQuads = std::numeric_limits<nzUInt16>::max()/6;
unsigned int s_vertexBufferSize = 4*1024*1024; // 4 MiB
}