News for hackers. Stuff that matters.
Re:Having fun abusing the C language by bodyfour on Tuesday October 25, 2016 @11:17AM (#12788654)
The only time I've found it useful is making macros that expect an array a little safer in C++. For example:

    #define count(array) (sizeof(array) / sizeof(0[array]))
...will conveniently cause a compile error if you accidentally pass in a std::vector instead of an array.
Re:Having fun abusing the C language by jasode on Tuesday October 25, 2016 @11:29AM (#12788769)
Thanks for the heads up. Not suprisingly, a related stackoverflow q&a mentions that macro and also another more convoluted one from Chromium that protects against accidental pointers being passed: http://stackoverflow.com/a/1598827