Steve Teale wrote:
Perhaps a bug? If this is written as a normal function template it seems
to work the same way, but has the advantage of generating better Ddoc
information. That is:
T enforceEx(E, T)(T value, lazy string msg = "")
{
if (!value) throw new E(msg);
return value;
}
instead of:
template enforceEx(E)
{
T enforceEx(T)(T value, lazy string msg = "")
{
if (!value) throw new E(msg);
return value;
}
}
The function was indeed written that way to navigate around a limitation. Andrei
