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:
...will conveniently cause a compile error if you accidentally pass in a std::vector instead of an array.
[ Parent
| on HN ]
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