how to handle void arguments in generic programming ?

Timothee Cour thelastmammoth at gmail.com
Sun Nov 10 19:52:01 PST 2013


The code snippet below doesn't work. Is there a way to make it work?

import std.stdio;
void main(){
  writelnIfNonVoid(writeln("ok"));
}
void writelnIfNonVoid(T...)(T a){
  static if(T.length)
    writeln(a);
}
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.puremagic.com/pipermail/digitalmars-d-learn/attachments/20131110/34da272d/attachment.html>


More information about the Digitalmars-d-learn mailing list