[Issue 12461] Typedef and opOpAssign
    via Digitalmars-d-bugs 
    digitalmars-d-bugs at puremagic.com
       
    Wed Apr 23 13:14:41 PDT 2014
    
    
  
https://issues.dlang.org/show_bug.cgi?id=12461
Andrej Mitrovic <andrej.mitrovich at gmail.com> changed:
           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |andrej.mitrovich at gmail.com,
                   |                            |k.hara.pg at gmail.com
--- Comment #1 from Andrej Mitrovic <andrej.mitrovich at gmail.com> ---
This seems to be a Proxy issue. Kenji, if I add the following to Proxy:
-----
private enum getField(T) = is(T == typeof(this)) 
    ? ("." ~ __traits(identifier, a)) : "";
auto ref opOpAssign(string op, this X, V)(auto ref V v)
{
    return mixin("a " ~ op ~ "= v" ~ getField!V);
}
-----
Then the OP code will work. But I'm not sure if this is the appropriate fix. Do
you have a better idea?
--
    
    
More information about the Digitalmars-d-bugs
mailing list