We need a typesystem-sanctioned way to cast qualifiers away

Daniel N via Digitalmars-d digitalmars-d at puremagic.com
Sat Jun 20 00:30:24 PDT 2015


On Saturday, 20 June 2015 at 00:07:12 UTC, Andrei Alexandrescu 
wrote:
> Again, the reference to IAllocator must be unqualified even 
> inside an otherwise qualified object.
>
no love for a container factory?

struct IAllocator{}
struct container(T){}

template factory(T)
{
   struct factory
   {
     T          contain; // potentially const
     IAllocator mutable;

     alias contain this;
   }
}

auto c = factory!(const container!uint)();



More information about the Digitalmars-d mailing list