--- Comment #2 from 2011-02-08 00:42:20 PST ---
After thinking about the problem a bit more, I have a couple things to add.

First, I should mention my second point for assigning the return value of a
function to an existing struct applies to all temporaries.

Test testVal;
testVal = Test("str");

can benefit from the same optimizations as

Test testVal;
testVal = function();

Second, it would be very useful to be able to mark the custom assignment
operator to have the same behavior on the above two cases as if there is no
overloaded assignment operator. (aka: skip the assignment and reduce it to a
blit + post blit and destruction of the old value when assigning from a
temporary) I would suggest something like putting "@ignoreIfTemp" before the
opAssign definition, and would be ignored if members of the struct have custom
assignment operators without that property. This would allow one of the most
useful benefits of rvalue references from C++0x to be used without having to
add a whole new type qualifier.

Configure issuemail:
------- You are receiving this mail because: -------

Reply via email to