<br><br><div class="gmail_quote">On Sat, May 16, 2009 at 2:07 PM, Vyacheslav Kononenko <span dir="ltr"><<a href="mailto:vyacheslav@kononenko.net">vyacheslav@kononenko.net</a>></span> wrote:<br><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
<div class="im">> But implicit assignment operators are not user-defined. I just wonder<br>
> how hard we should try in making POD types feel like built-ins.<br>
</div>You mean by behavior or error message should be the same as for<br>
builtin? I think implicit assignment operator should provide the same<br>
behavior.<br>
<div class="im"><br>
> I'm not sure, but I don't think our lookup automatically limits it to<br>
> those operators that are viable for the left-hand side, so we'd have to<br>
> filter all others out manually. We certainly don't want every possible<br>
> assignment operator in that list.<br>
</div>No, of course not. Only assignment operators from the class and<br>
parents. Yes that will require filtering the list. Another idea is to<br>
print "incompatible type" message when there is only one assignment<br>
operator available. That will require filtering that list as well.<br></blockquote><div><br><br>I may have missed it in the discussion so far - apologies if I did.<br><br>The discussion so far <i>seems</i> to have left out the fact that if the<br>
programmer doesn't specify a user-defined assignement operator for <br>class type T, then  the compiler is supposed to generate an assginment<br>operator. This compiler-generated assignment operator member function<br>
then does a bitwise copy of the member data.<br><br>[  It is up to the programmer for class T to know when the compiler-generated<br>assignment operator will be sufficient or not - and if they choose to use <br>the compiler-generated when it's not safe then they can get incorrectly <br>
behaving code. OTOH, if they choose to always write their own, then they<br>may be bloating their code and slowing down fundamental operations. ]<br><br>Again, if this part of the spec <i>wasn't</i> left out (or forgotten), then apologies<br>
for the wasted bandwith.<br><br> </div></div>Brian<br>