Yeah, you're right (case (1) also works with a template ctor as well - in C++ this would allow for implicit conversions as well, that's why I thought about using it this way). As I said, I had already abandoned this approach and decided on using .mangleof sorting anyway for elegance. I think my proposal write-up is almost ready, will submit it today or tomorrow.<div>
<br></div><div><br></div><div><br clear="all">(Cristi Cobzarenco)<br>Pofile: <a href="http://www.google.com/profiles/cristi.cobzarenco">http://www.google.com/profiles/cristi.cobzarenco</a><br>
<br><br><div class="gmail_quote">On 30 March 2011 15:26, David Nadlinger <span dir="ltr"><<a href="mailto:see@klickverbot.at">see@klickverbot.at</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;">
<div class="im">On 3/30/11 11:21 AM, Cristi Cobzarenco wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
Seems right to me, am I missing something?<br>
</blockquote>
<br></div>
opAssign isn't taken into consideration when initializing variables or passing values to functions. An example probably says more than thousand words:<br>
<br>
---<br>
struct Test {<br>
ref Test opAssign(int i) {<br>
value = i;<br>
return this;<br>
}<br>
int value;<br>
}<br>
<br>
void foo(Test t) {}<br>
<br>
void main() {<br>
// Neither of the following two lines compiles, IIRC:<br>
Test t = 4; // (1)<br>
foo(4); // (2)<br>
}<br>
---<br>
<br>
You can make case (1) work by defining a static opCall taking an int, which will be called due to property syntax, but I can't think of any solution for (2).<br><font color="#888888">
<br>
David<br>
</font></blockquote></div><br></div>