variadic mixin - the right tool for the job?

Robert M. Münch via Digitalmars-d-learn digitalmars-d-learn at puremagic.com
Wed Mar 18 07:35:03 PDT 2015


Hi, can something like this (I borrowed the C pre-processor idea) be 
done with variadic mixins?

#define log(variadic-arg)  sys-log("%s:%s" + variadic-arg[0], __FILE__, 
__LINE__, variadic-arg[1..$]);

I read that mixins can only be used for declarations, and this here is 
a function call. So wondering, how something like this can be done.

-- 
Robert M. Münch
http://www.saphirion.com
smarter | better | faster



More information about the Digitalmars-d-learn mailing list