On Wednesday, 20 January 2016 at 10:44:36 UTC, Rikki Cattermole wrote: > > 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!