Core/OffsetOf: Remove constexpr (cannot be used because of reinterpret_cast)
Former-commit-id: 78142eb9033a1969f20055b2cecf1bc78152e896
This commit is contained in:
parent
e89b87044d
commit
80208b0dc5
|
|
@ -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 M> M NzImplGetMemberType(M T::*);
|
||||||
|
|
||||||
template <typename T, typename R, R T::*M>
|
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));
|
return reinterpret_cast<std::size_t>(&((static_cast<T*>(0))->*M));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -31,8 +31,6 @@ namespace
|
||||||
NzVector2f uv;
|
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_maxQuads = std::numeric_limits<nzUInt16>::max()/6;
|
||||||
unsigned int s_vertexBufferSize = 4*1024*1024; // 4 MiB
|
unsigned int s_vertexBufferSize = 4*1024*1024; // 4 MiB
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -31,8 +31,6 @@ namespace
|
||||||
NzVector2f uv;
|
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_maxQuads = std::numeric_limits<nzUInt16>::max()/6;
|
||||||
unsigned int s_vertexBufferSize = 4*1024*1024; // 4 MiB
|
unsigned int s_vertexBufferSize = 4*1024*1024; // 4 MiB
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue