On Thursday, 16 July 2015 at 18:41:47 UTC, Gary Willoughby wrote:
bool hasItemParent(A, B)(A itemId, B parentId)
if (isSomeString!(A) && (isSomeString!(B) || isArray!(B) && isSomeString!(ElementType!(B))))

Thank you ! I completely missed isSomeString.

I think the definition can be safely shortened to:
bool hasItemParent(T)(const(char)[] itemId, T parentId)
if (isSomeString!T || isSomeString!(ElementType!T))

Minor flaw, as it is the function also accepts wchar[] and dchar[] that break the compilation because I do comparisons with char[].

Reply via email to