diff options
Diffstat (limited to 'gfx')
| -rw-r--r-- | gfx/gl/glVertexArray.h | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/gfx/gl/glVertexArray.h b/gfx/gl/glVertexArray.h index 791f74f..323303c 100644 --- a/gfx/gl/glVertexArray.h +++ b/gfx/gl/glVertexArray.h @@ -11,10 +11,12 @@ namespace Impl { template<typename M, typename T> struct MP { constexpr MP(M T::* ptr) : ptr {ptr} { } + constexpr operator GLuint() const { - return static_cast<GLuint>(reinterpret_cast<const char *>(&(static_cast<T *>(nullptr)->*ptr)) - - static_cast<const char *>(nullptr)); + constexpr static char dummy {}; + return static_cast<GLuint>(reinterpret_cast<const char *>(&(reinterpret_cast<const T *>(&dummy)->*ptr)) + - reinterpret_cast<const char *>(&dummy)); } M T::* ptr; |
