Boost logo

Boost :

From: David Abrahams (dave_at_[hidden])
Date: 2006-06-28 08:55:11


Gennaro Prota <gennaro_prota_at_[hidden]> 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

Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk