Trouble creating a formatted assert wrapper

Peter Alexander peter.alexander.au at gmail.com
Sun Sep 2 13:14:25 PDT 2012


On Sunday, 2 September 2012 at 19:31:24 UTC, timotheecour wrote:
>>>> void myAssert(int line = __LINE__, string file = __FILE__, 
>>>> Args...)(lazy bool condition, lazy Args args) {
>
> Won't that create "template code bloat" ? Ie everytime myAssert 
> is used a new function is created.

You can easily counter that by delegating the body to a 
non-template function.

Even then, it's only in non-release builds and it's a small 
function anyway.



More information about the Digitalmars-d mailing list