const debacle

Janice Caron caron800 at googlemail.com
Sat Mar 22 04:51:11 PDT 2008


On 22/03/2008, e-t172 <e-t172 at akegroup.org> wrote:
>  A better
>  idea would be to include a new "feature" in D 2.0, i.e. "compiled
>  templates", with a new syntax like this :
>
>  T[] trim(T # [char,dchar,wchar]) (T[] source)

I believe you can already do that - albeit with a different syntax.

    T[] trim(T) (T[] source)
    {
        /*...*/
    }

    private
    {
        alias trim!(char) dummy1;
        alias trim!(wchar) dummy2;
        alias trim!(dchar) dummy3;
    }

I think those aliases will force an instantiation.



More information about the Digitalmars-d mailing list