Just reading the #ImGui source and stumbled across the OFFSETOF macro which I hadn't seen before. Cool technique! (http://www.geeksforgeeks.org/the-offsetof-macro/ …)
@bkaradzic @nlguillemot @pr0g89 That macro entails undefined behavior. offsetof is in the Standard; I’d stick with it & not get too clever.
-
-
@warrenm@bkaradzic@nlguillemot Yup stddef.h has a number of different implementations of it depending on platform. Was just interesting :) -
@pr0g89@warrenm@bkaradzic@nlguillemot don't listen to these guys tom! Be who you wanna be! And then deal with the consequences. -
@jonnyhopper@warrenm@bkaradzic@nlguillemot Haha it's cool, I was really more interested in the *how* it works than suggesting its use :) -
@jonnyhopper@warrenm@bkaradzic@nlguillemot Good to know about the std ver but also fun to appreciate why it works, do love those tricks! - 1 more reply
New conversation -
-
-
@warrenm@bkaradzic@nlguillemot@pr0g89 May be in the Standard but not all platforms follow the Standard, especially not consoles.Thanks. Twitter will use this to make your timeline better. UndoUndo
-
-
-
@warrenm@bkaradzic@pr0g89 I can imagine compilers and static analyzers would freak out because of the macro version...Thanks. Twitter will use this to make your timeline better. UndoUndo
-
Loading seems to be taking a while.
Twitter may be over capacity or experiencing a momentary hiccup. Try again or visit Twitter Status for more information.