On Sep 15, 2008, at 4:43 PM, Alex Reynolds wrote:

Is there a difference in the underlying storage between vector<BOOL> and
vector<bool>?

Yes! std::vector is a class template. There's a generic implementation provided that works with any type (within certain constraints), but there's a specialization for the 'bool' case. You only get ~1 bit for bit with the specialization, i.e. vector<bool>.

Given that BOOL is typedef'ed to signed char, vector<BOOL> uses the same storage as vector<signed char>, about 1 byte per element.

Cheers,
Ken
_______________________________________________

Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to [EMAIL PROTECTED]

Reply via email to