Ah! I saw that #define but didn't see the bit about failing on C++ objects that overload operator[]. I don't do C++ much so that really didn't occur to me.
I personally prefer sizeof(*(arr)), which is the same as arr[0], but I suppose C++ lets you overload that as well.
---
Get the number of elements in an array:
(0[arr] is identical to arr[0] for arrays but will intentionally fail if it's used against a C++ object that overloads operator[].)He gives a C++ template version, too.
---
... 10k+ users on Stack Overflow can see deleted stuff. Or you can probably get them out of the CC data dumps (but that's a lot more work than you want, probably). Or maybe out of the data explorer.