
28 Jun
2006
28 Jun
'06
12:55 p.m.
Gennaro Prota <gennaro_prota@yahoo.com> writes:
When you write something like, for instance,
COUNT_OF_N(3, x)
though, it's not enough to check that x is an array. It shall be an array, x[0] shall be an array, x[1] and x[2] shall be arrays. I can imagine implementing it with some pp-lib iteration which automatically generates
sizeof(x[0])/sizeof(x[0][0]) sizeof(x[0][0])/sizeof(x[0][0][0]) sizeof(x[0][0][0])/sizeof(x[0][0][0][0])
up to a given limit,
So what's wrong with that?
but I'm not sure it can *reliably* be done with templates only.
You need a macro anyway, don't you? -- Dave Abrahams Boost Consulting www.boost-consulting.com