Boost logo

Boost :

From: David Abrahams (dave_at_[hidden])
Date: 2006-06-25 11:37:51

Gennaro Prota <gennaro_prota_at_[hidden]> writes:

> Hi guys,
> a while ago there was some discussion about incorporating a
> compile-time array count facility in boost. I also provided an
> implementation for multidimensional arrays. Is there still interest
> for this? The benefits over the classical
> sizeof(array)/sizeof(array[0]) idiom are not overwhelming but at least
> there's a fair syntactical convenience and, of course, the advantage
> of unit test integration. If there's interest I can add it, to the
> utility subdirectory I guess (better suggestions are welcome; I really
> don't like using utility/ as a sort of repository for anything we have
> no better place for).

The biggest argument for such a mechanism is that it should be more
foolproof. I hope it causes a compile error if "array" turns out to
be a pointer.

Dave Abrahams
Boost Consulting

Boost list run by bdawes at, gregod at, cpdaniel at, john at