I was looking at a code used to wrapped lua into a C++ application.
I was very surprised to find this:
#define for if (false) {} else for
I don't understand the meaning of this. To me, it seems useless to do something like that.
Does it have to do something with some compiler tricks or something else ?
PS: The library I was looking at is luabind.
I've seen something similar to this to mitigate a compiler bug where the scoped of the for-variable leaked outside of the for-statement.
Related: /Zc:forScope (Force Conformance in for Loop Scope).
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With