We have 'void' (no type),but we don't have 'any' (any type).

nojoking kuangdong at gmail.com
Sun Sep 24 08:45:15 PDT 2006


any opIndex(char[] key)
{
  if(auto x=key in strarr)
    return cast(char[])*x;
  else if(auto y=key in intarr)
    return cast(int)*y;
  else if(auto z=key in bolarr)
    return cast(bool)*z;
  else
    throw new Exception("key not found: '" ~ key ~"'";
}



More information about the Digitalmars-d-learn mailing list