<div>Actually T() would definitely do the job. Thanks for pointing. A can agree it&#39;s a good replacement.</div><div><br></div><div>As for requiring to conform to a protocol - definitely worse solution. I was thinking of DefaultConstructable as of automatically applied protocol to anything that has init().</div><div><br></div><div>About &quot;Zero&quot; or &quot;Identity&quot; concept I personally tend to think of it as of a singleton static property. Also keeping in mind everything said above in the discussion these two are just different protocols. I.e. for Int &quot;zero&quot; could be 0 and &quot;identity&quot; could be 1. Identity does not feel to be the right name, though.</div><div><br></div><div>Also, for the &quot;zeroable&quot; types I would rather use nil.</div><div><br><div class="gmail_quote"><div>On Tue, 27 Dec 2016 at 10:40 Braeden Profile via swift-evolution &lt;<a href="mailto:swift-evolution@swift.org">swift-evolution@swift.org</a>&gt; wrote:<br></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div style="word-wrap:break-word" class="gmail_msg"><div class="gmail_msg">I forgot to reply to the email list here.</div><div class="gmail_msg"><br class="gmail_msg"></div><div class="gmail_msg"><div class="gmail_msg"><div style="word-wrap:break-word" class="gmail_msg"><div class="gmail_msg"><blockquote type="cite" class="gmail_msg"><div class="gmail_msg">On Dec 26, 2016, at 10:03 PM, Xiaodi Wu &lt;<a href="mailto:xiaodi.wu@gmail.com" class="gmail_msg" target="_blank">xiaodi.wu@gmail.com</a>&gt; wrote:</div><br class="m_5731337213789850139Apple-interchange-newline gmail_msg"><div class="gmail_msg">Did you mean to reply offlist?<br class="gmail_msg"><br class="gmail_msg">Basically, a factory would be:<br class="gmail_msg"><br class="gmail_msg">func make&lt;T&gt;(_: T.Type) -&gt; T { return T() }<br class="gmail_msg"><br class="gmail_msg">but you need T to conform to a protocol that guarantees T.init(). You use it like:<br class="gmail_msg"><br class="gmail_msg">make(Foo.self)<br class="gmail_msg"><br class="gmail_msg">But one can write:<br class="gmail_msg"><br class="gmail_msg">func make&lt;T&gt;(_ f: @autoclosure () -&gt; T) -&gt; T { return f() }<br class="gmail_msg"><br class="gmail_msg">and use this like:<br class="gmail_msg"><br class="gmail_msg">make(Foo())<br class="gmail_msg"><br class="gmail_msg">(pardon typos; freehanding on iPad)<br class="gmail_msg"><br class="gmail_msg"><br class="gmail_msg"><br class="gmail_msg"><div class="gmail_quote gmail_msg"><div class="gmail_msg">On Mon, Dec 26, 2016 at 23:58 Braeden Profile &lt;<a href="mailto:jhaezhyr12@gmail.com" class="gmail_msg" target="_blank">jhaezhyr12@gmail.com</a>&gt; wrote:<br class="gmail_msg"></div><blockquote class="gmail_quote gmail_msg" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div style="word-wrap:break-word" class="gmail_msg"><div class="gmail_msg">Actually, I’m a little lost at this point of exactly how you could build a function with this pattern.  Code, anyone?</div></div></blockquote></div></div></blockquote></div></div></div></div></div><div style="word-wrap:break-word" class="gmail_msg"><div class="gmail_msg"><div class="gmail_msg"><div style="word-wrap:break-word" class="gmail_msg"><div class="gmail_msg"><blockquote type="cite" class="gmail_msg"><div class="gmail_msg"><div class="gmail_quote gmail_msg"><blockquote class="gmail_quote gmail_msg" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div style="word-wrap:break-word" class="gmail_msg"><br class="gmail_msg"><div class="gmail_msg"><blockquote type="cite" class="gmail_msg"><div class="gmail_msg">On Dec 26, 2016, at 9:57 PM, Xiaodi Wu &lt;<a href="mailto:xiaodi.wu@gmail.com" class="gmail_msg" target="_blank">xiaodi.wu@gmail.com</a>&gt; wrote:</div><br class="m_5731337213789850139m_2382602459962088654Apple-interchange-newline gmail_msg"><div class="gmail_msg">With @autoclosure your user can simply write T() as an argument. It is very elegant and not complicated at all.<br class="gmail_msg"></div></blockquote></div></div></blockquote></div></div></blockquote></div></div></div></div></div>_______________________________________________<br class="gmail_msg"><br>swift-evolution mailing list<br class="gmail_msg"><br><a href="mailto:swift-evolution@swift.org" class="gmail_msg" target="_blank">swift-evolution@swift.org</a><br class="gmail_msg"><br><a href="https://lists.swift.org/mailman/listinfo/swift-evolution" rel="noreferrer" class="gmail_msg" target="_blank">https://lists.swift.org/mailman/listinfo/swift-evolution</a><br class="gmail_msg"><br></blockquote></div></div>