On Monday, 27 April 2015 at 14:30:26 UTC, Kagamin wrote:
Use a different type to match empty slice instead of void[]?
struct ArrayWrapper(T)
{
T t;
this(T t)
{
assert(t !is null);
}
@disable this(typeof(null));
@disable this(ArrayWrapper[]); //should match []
typeof(this) opAssign(T val)
{
assert(t !is null);
this.t = val;
return this;
}
@disable typeof(this) opAssign(typeof(null));
@disable typeof(this) opAssign(ArrayWrapper[]); //should
match []
}
That won't work because I want to catch the [] literal, which is
of type void[] and not ArrayWrapper[].