wrapping functions with variadic-parameter wrappers

Gor Gyolchanyan gor.f.gyolchanyan at gmail.com
Wed Dec 5 23:40:24 PST 2012


On Thu, Dec 6, 2012 at 10:02 AM, Jonathan M Davis <jmdavisProg at gmx.com>wrote:

> On Wednesday, December 05, 2012 19:40:44 Gor Gyolchanyan wrote:
> > A function with variadic template parameters is just a function which
> takes
> > a set of compile-time known parameters.
> > My goal is to have a non-template function taking variadic parameters.
> >
> > long bar(...)
> > {
> >     return foo(...);
> > }
> >
> > This is necessary to be able to pass variables to functions without
> knowing
> > the type of the functions.
>
> Then read the section on variadic functions and pick which type works best
> for
> you: http://dlang.org/function.html
>
> - Jonathan M Davis
>
>
> P.S. Please stop top posting. It's generally considered rude in lists like
> this.
>

Sorry, force of habit. Gmail puts me at the top and hides the message by
default,
I read about the d-style variadic functions and I also read the ABI.
There are some vast differences in the ABI (the parameters are pushed in
reverse order, the caller must clean the stack...).
I thought that you guys have a better understanding of what's going on, so
you might help me with this.
If done carefully it could be a very valuable addition to std.functional.

-- 
Bye,
Gor Gyolchanyan.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.puremagic.com/pipermail/digitalmars-d/attachments/20121206/4b2ecd1c/attachment-0001.html>


More information about the Digitalmars-d mailing list