Re: Swift and Threads
Re: Swift and Threads
- Subject: Re: Swift and Threads
- From: Alastair Houghton <email@hidden>
- Date: Tue, 13 Sep 2016 08:43:30 +0100
On 13 Sep 2016, at 05:29, Jens Alfke <email@hidden> wrote:
>
> The Bool type is one byte in size.
>
> C++ has a specialization for std::vector<bool> that makes it a true bit array, but I’m not sure if Swift’s generic system is powerful enough to be able to entirely switch out the implementation based on the parameter type.
Before anyone thinks it’s a good idea to copy that idea straight into Swift’s standard library, std::vector<bool> doesn’t behave quite the same as the other std::vector<> implementations, and the specialisation is widely regarded as a mistake. It’d be a *really* good idea to avoid making similar mistakes in Swift.
(Also, there’s a strong argument for having a separate bit vector type, with set-like operations, support for sparse bit vectors and the like.)
Kind regards,
Alastair.
--
http://alastairs-place.net
_______________________________________________
Cocoa-dev mailing list (email@hidden)
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:
This email sent to email@hidden