The Final(ize) Challenge

Jarrett Billingsley jarrett.billingsley at gmail.com
Mon May 18 14:05:59 PDT 2009


On Mon, May 18, 2009 at 5:02 PM, Denis Koroskin <2korden at gmail.com> wrote:
>
> template Finalize(T)
> {
>   final class Finalize : T
>   {
>       this(Args...)(Args args)
>       {
>           super(args);
>       }
>   }
> }
>
> The following code /should/ work as you ask. There is no need to iterate
> over all the methods and make a final version out of it for two reasons
> 1) It is redundant
> 2) It creates an additional overhead

If you ask __traits(isFinalFunction, Finalize!(C).something), you
always get false.



More information about the Digitalmars-d mailing list