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

Tony Allevato allevato at google.com
Mon May 2 16:24:50 CDT 2016


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. :)
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.swift.org/pipermail/swift-evolution/attachments/20160502/6974033f/attachment.html>


More information about the swift-evolution mailing list