[Issue 13291] unittest should be allowed inside template functions

via Digitalmars-d-bugs digitalmars-d-bugs at puremagic.com
Thu Aug 14 11:00:47 PDT 2014


https://issues.dlang.org/show_bug.cgi?id=13291

timon.gehr at gmx.ch changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |timon.gehr at gmx.ch

--- Comment #1 from timon.gehr at gmx.ch ---
(In reply to Andrei Alexandrescu from comment #0)
> there's no way to instantiate and fire a unittest for each instantiation of a function template.

This is actually not true (also pointed out by Meta on the forum):

template fun(T){
    void fun(T arg){
        ... stuff ...
    }
    unittest{
        ... unittest for each T instantiated ...
    }
}

I.e. this enhancement suggests a shorthand syntax.

--


More information about the Digitalmars-d-bugs mailing list