std.typecons.Proxy requires a nothrow destructor and toHash?

Saurabh Das via Digitalmars-d-learn digitalmars-d-learn at puremagic.com
Wed Feb 3 02:16:56 PST 2016


struct A
{
     import std.stdio;
     File f;
}

struct B
{
     A a;

     import std.typecons;
     mixin Proxy!a;
}

rdmd proxytest.d:
/Library/D/dmd/src/phobos/std/typecons.d(5055): Error: 
'proxytest.A.~this' is not nothrow
/Library/D/dmd/src/phobos/std/typecons.d(5050): Error: function 
'proxytest.B.Proxy!(a).toHash' is nothrow yet may throw
Failed: ["dmd", "-v", "-o-", "proxytest.d", "-I."]

Why doesn't this work? Is it a requirement that a proxied struct 
must have a nothrow destructor and toHash?



More information about the Digitalmars-d-learn mailing list