On Mon, 31 Oct 2011 06:30:40 -0400, Steve Teale <steve.te...@britseyeview.com> 
wrote:
Robert,

Maybe you can fix this along the way:

import std.variant;
struct B
{
   int p, q, r, s;
}
typedef B C;

void main()
{
   B b;
   C c;
   b = c;   // ok
   Variant v = c;
   assert(v.convertsTo!(B));   // no dice
}

Steve

As others have mentioned, typedef is being deprecated. That said, variant now 
supports duck-typing. So 'v.to!B()' works. However, 'convertsTo's mandate is to 
test for implicit conversion, which isn't covered as there's no way in __traits 
to recover a typedef's base type.

Reply via email to