template CanSlice(T) {enum CanSlice = __traits(compiles, {T t; auto v = t[0 .. 1];}) || __traits(compiles, {T t; auto v = t.opSlice();});}Should work.
Thanks it works just fine!
chardetm via Digitalmars-d-learn Wed, 20 Jan 2016 03:01:18 -0800
template CanSlice(T) {enum CanSlice = __traits(compiles, {T t; auto v = t[0 .. 1];}) || __traits(compiles, {T t; auto v = t.opSlice();});}Should work.
Thanks it works just fine!