Re: Copy parameters from function passed as an alias

2018-10-11 Thread Kagamin via Digitalmars-d-learn
On Thursday, 11 October 2018 at 06:30:01 UTC, bauss wrote: To give the real world example. I'm converting a function into a soap envelope which means the identifiers must be the same because the parameter names passed in the soap envelope must have the same names. Basically what I wanted was

Re: Copy parameters from function passed as an alias

2018-10-11 Thread bauss via Digitalmars-d-learn
On Thursday, 11 October 2018 at 07:44:04 UTC, Simen Kjærås wrote: Now, is this the only way to inform the soap factory of your parameter names? Could you instead pass them more explicitly? The variable example is actually a good alternative. I like it. To answer your question however, yes

Re: Copy parameters from function passed as an alias

2018-10-11 Thread Simen Kjærås via Digitalmars-d-learn
On Thursday, 11 October 2018 at 06:30:01 UTC, bauss wrote: Because I'm constructing something from the parameters. To give the real world example. I'm converting a function into a soap envelope which means the identifiers must be the same because the parameter names passed in the soap envelop

Re: Copy parameters from function passed as an alias

2018-10-10 Thread bauss via Digitalmars-d-learn
On Wednesday, 10 October 2018 at 18:15:52 UTC, Paul Backus wrote: On Wednesday, 10 October 2018 at 12:10:06 UTC, bauss wrote: On Wednesday, 10 October 2018 at 08:16:11 UTC, Kagamin wrote: How do you want to use parameter names of an arbitrary function? What I want to do is pass a function to

Re: Copy parameters from function passed as an alias

2018-10-10 Thread Paul Backus via Digitalmars-d-learn
On Wednesday, 10 October 2018 at 12:10:06 UTC, bauss wrote: On Wednesday, 10 October 2018 at 08:16:11 UTC, Kagamin wrote: How do you want to use parameter names of an arbitrary function? What I want to do is pass a function to a template and that template creates a function with the same para

Re: Copy parameters from function passed as an alias

2018-10-10 Thread bauss via Digitalmars-d-learn
On Wednesday, 10 October 2018 at 08:16:11 UTC, Kagamin wrote: How do you want to use parameter names of an arbitrary function? What I want to do is pass a function to a template and that template creates a function with the same parameters as the function passed to it, if it wasn't clear. I

Re: Copy parameters from function passed as an alias

2018-10-10 Thread Kagamin via Digitalmars-d-learn
How do you want to use parameter names of an arbitrary function?

Copy parameters from function passed as an alias

2018-10-09 Thread bauss via Digitalmars-d-learn
Is there a way to copy parameters from a passed function as an alias. Ex: void foo(alias fun)(...); where ... should be the parameters of fun. Of course std.traits.Parameters works like: void foo(alias fun)(Parameters!fun); But the catch is that you don't get the identifiers. So what is th