www.digitalmars.com         C & C++   DMDScript  

digitalmars.D - Workaround for Issue 6906

reply "Rene Zwanenburg" <renezwanenburg gmail.com> writes:
It appears I'm running into issue 6906, meaning it's impossible 
to store structs in an AA if they have opAssign defined. For 
example:

struct S {

}
Mar 22 2012
parent "Rene Zwanenburg" <renezwanenburg gmail.com> writes:
On Thursday, 22 March 2012 at 20:08:02 UTC, Rene Zwanenburg wrote:
 It appears I'm running into issue 6906, meaning it's impossible 
 to store structs in an AA if they have opAssign defined. For 
 example:

 struct S {

 }
Apologies, sent before I finished. Tab + enter in the web interface. struct S { void opAssign(S s) { // for the AA assign, 'this' is invalid here } } S[int] sAA; sAA[1] = S(); Is there a workaround? I'm storing smart pointers in an AA, the combination incorrect this + reference counting destructor is fatal.
Mar 22 2012