Template function that accept strings and array of strings

badlink via Digitalmars-d-learn digitalmars-d-learn at puremagic.com
Thu Jul 16 12:42:15 PDT 2015


After a thorough reading of the documentation I found an even 
simpler solution:

bool hasItemParent(T)(const(char)[] itemId, T parentId)
if (is(T : const(char)[]) || is(T : const(char[])[]))
{ ... }

Now it accepts all these: char[], const(char)[], 
immutable(char)[], char[][], const(char)[][] ,immutable(char)[][] 
but not their wchar and dchar counterparts.



More information about the Digitalmars-d-learn mailing list