On Thursday, 29 December 2011 at 06:09:17 UTC, Andrei Alexandrescu wrote:
Nah, that still breaks a lotta code because people parameterize on T[], use isSomeString/isSomeChar etc.

/* snip struct string */

import std.traits;
void tem(T)(T t) if(isSomeString!T) {}
void tem2(T : immutable(char)[])(T t) {}

string a = "test";
tem(a); // works
tem2(a); // works


It's the alias this magic again.

(btw I also tried renaming struct string to
struct STRING, and it still worked, so it wasn't
just naming coincidence!)

Reply via email to