• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Re: Swift and Threads
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

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


References: 
 >Swift and Threads (From: "Gerriet M. Denkmann" <email@hidden>)
 >Re: Swift and Threads (From: Jens Alfke <email@hidden>)
 >Re: Swift and Threads (From: "Gerriet M. Denkmann" <email@hidden>)
 >Re: Swift and Threads (From: Jens Alfke <email@hidden>)

  • Prev by Date: Re: Swift and Threads
  • Next by Date: Re: Swift and Threads
  • Previous by thread: Re: Swift and Threads
  • Next by thread: Re: Swift and Threads
  • Index(es):
    • Date
    • Thread