Tuesday, March 13, 2018 [Tweets] [Favorites]

Swift 4.1 Conditional Conformance Is Amazing

Stephen Celis:

Here’s a non-empty collection type that works with any collection.

Wrapping a MutableCollection type gives the non-empty type all those methods for free!

Previously: Conditional Conformance in the Standard Library.

Update (2018-03-23): See also: Swift Unwrapped.

Update (2018-03-27): See also: Swift Unwrapped.

Update (2018-05-01): See also: Ole Begemann.

1 Comment

[…] Swift 4: Synthesizing Equatable and Hashable Conformance, Swift 4.1 Conditional Conformance Is Amazing, Code Size Optimization Mode in Swift […]

Stay up-to-date by subscribing to the Comments RSS Feed for this post.

Leave a Comment