[swift-evolution] [Proposal] Improving operator requirements in protocols

Xiaodi Wu xiaodi.wu at gmail.com
Mon May 2 18:22:38 CDT 2016


On Mon, May 2, 2016 at 4:24 PM, Tony Allevato <allevato at google.com> wrote:

> On Mon, May 2, 2016 at 2:01 PM Xiaodi Wu <xiaodi.wu at gmail.com> wrote:
>
>> Maybe one minimalist approach could be to have these take two arguments
>> as though it's an infix operator where one of lhs or rhs is Void:
>>
>> T.++(&value, ()) //postfix
>> T.++((), &value) // prefix
>
>
> This feels a little too much like the "magic unused int" parameter that
> C++ uses to differentiate prefix/postfix operators. My biggest concern
> would be that I always have to look up which is which when I need to
> override them because I can never remember it for longer than a few hours.
> :)
>

Yeah, true. I had to check a few times while writing that email to make
sure I'd written what I thought I had :) Not a good idea, clearly.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.swift.org/pipermail/swift-evolution/attachments/20160502/97e781f7/attachment.html>


More information about the swift-evolution mailing list