Boost logo

Boost :

From: Michael Marcin (mmarcin_at_[hidden])
Date: 2006-08-04 22:18:46

Gennaro Prota wrote:
> On Sat, 08 Jul 2006 11:11:12 -0700, Jeff Garland
> <jeff_at_[hidden]> wrote:
>> Gennaro Prota wrote:
>>> Any feedback appreciated, though likely only Dave will be interested
>>> ;)
>> Probably best to upload these sort of files to the vault -- they
>> don't tend to come thru mail firewalls.
> Thanks. It's in the vault root now, with the same filename:
> "array_count proposal"

The usage wasn't immediately apparent to me.
It suprised me that I had to look a the docs to use this one.
Take for example:

float myfloats[24] = {0};
size_t count = sizeof boost::count_of( myfloats ); // count = 24

This seems to suggest you are getting the size of the count of the array.
If spoken aloud that brings to my mind something like:
sizeof( size_t ) == sizeof boost::count_of( myfloats )

I would have expected

float myfloats[24] = {0};
size_t count = boost::count_of( myfloats ); // count = 24

The sizeof seems like an implementation detail.
Is it possible to hide it from the user?

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