Problem: handling a function dependent on release mode.

Andrej Mitrovic andrej.mitrovich at gmail.com
Sun Jul 22 14:40:16 PDT 2012


On 7/22/12, Jonathan M Davis <jmdavisProg at gmx.com> wrote:
> Yeah. Don't have them be template parameters unless you need to, otherwise
> you
> get a different template instantiation _every_ time that you call the
> function.

I've just noticed something:

@property front(T)(T arr, string file = __FILE__, size_t line = __LINE__)
    if (isArray!T)
{
    enforce(arr.length, safeFmt("%s(%s): Cannot call front on empty
array.", file, line));
    return std.array.front(arr);
}

This errors at compilation: Error: properties can only have zero, one,
or two parameter

Do you think I should file this?


More information about the Digitalmars-d-learn mailing list