blob: bb572ddae3d4191e3c112d6434f65c4ad2c15c37 [file] [log] [blame]
// typecons.d
template RebindableCommon(T, U, This)
{
union { U stripped; }
void opAssign(T another)
{
stripped = cast() another;
}
this(T initializer)
{
opAssign(initializer);
}
}
template Rebindable(T)
{
static if (is(T == immutable U, U))
struct Rebindable
{
mixin RebindableCommon!(T, U, Rebindable);
}
}