[pitch]:generate == function


(J.E. Schotsman) #1

That relies on implicit var members making it *and* arbitrary length tuple comparison making it into the next Swift.

I am doing some round trip tests on large structs and need to define func == for each type <sigh>

Jan E.

···

On Jan 19, 2016, at 7:00 PM, Félix Cloutier wrote:

memberwise func ==? (if memberwise init does make it)


(Joe Groff) #2

We do generate Equatable implicitly in some cases, particularly for C-imported types and for Swift enums that don't use associated values. It would be reasonable to extend this to other types, by having 'struct Foo: Equatable' cause the compiler to generate an '==' implementation for you if you don't provide one.

-Joe

···

On Jan 19, 2016, at 12:14 PM, Jan E. Schotsman via swift-evolution <swift-evolution@swift.org> wrote:

On Jan 19, 2016, at 7:00 PM, Félix Cloutier wrote:

memberwise func ==? (if memberwise init does make it)

That relies on implicit var members making it *and* arbitrary length tuple comparison making it into the next Swift.

I am doing some round trip tests on large structs and need to define func == for each type <sigh>