[Issue 11202] Copy constructor is called instead of assignment on member

d-bugmail at puremagic.com d-bugmail at puremagic.com
Wed Oct 9 00:52:13 PDT 2013


http://d.puremagic.com/issues/show_bug.cgi?id=11202


monarchdodra at gmail.com changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |monarchdodra at gmail.com


--- Comment #1 from monarchdodra at gmail.com 2013-10-09 00:52:12 PDT ---
Hum... the issue is that T simply doesn't care about S's opAssign: It generates
its own opAssign via "postblit-copy-move" (of all of T at once I mean).

This isn't strictly *wrong*, its just a pretty dirty way of doing things, and
I'm pretty sure it's inefficient, and it definitly defeats the purpose of
having an opAssign to begin with.

It *is* the only way to provide *strong* exception guarantees though, for a
compiler generated elaborate opAssign, in case one of the member's opAssign
throws. *Should* we guarantee strong exception safety though? I'm unsure.

-- 
Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------


More information about the Digitalmars-d-bugs mailing list