
28 Jun
2006
28 Jun
'06
1:26 p.m.
I'm pretty sure it's easier than this. IIRC, the macro can still do the old sizeof(a)/sizeof(a[0]) trick; it just needs to add something that will cause an error if a is not an array.
So basically smth like: #define COUNT_OF(arr) BOOST_STATIC_ASSERT(boost::is_array<arr>::value); (sizeof(arr)/sizeof(arr[0])) ? Philippe p.s: not sure it actually works, just throwing ideas