Re: ReturnType and Parameters of Templated function/method

2016-10-13 Thread Patric Dexheimer via Digitalmars-d-learn
On Thursday, 13 October 2016 at 21:07:17 UTC, ketmar wrote: On Thursday, 13 October 2016 at 20:52:09 UTC, Patric Dexheimer wrote: So for now my idea is to brute force the numbers of arguments with 'compiles' trait or trying to get the sourcecode somehow. depending on source code form (even if

Re: ReturnType and Parameters of Templated function/method

2016-10-13 Thread ketmar via Digitalmars-d-learn
On Thursday, 13 October 2016 at 20:52:09 UTC, Patric Dexheimer wrote: So for now my idea is to brute force the numbers of arguments with 'compiles' trait or trying to get the sourcecode somehow. depending on source code form (even if you can get it) is highly error-prone. consider it UB.

Re: ReturnType and Parameters of Templated function/method

2016-10-13 Thread Patric Dexheimer via Digitalmars-d-learn
On Thursday, 13 October 2016 at 18:01:25 UTC, Ali Çehreli wrote: On 10/13/2016 07:19 AM, Patric Dexheimer wrote: There is a way to capture the return type/parameters of a templated function like: void add(T)(T t){} Parameters!add; Yes, i know that the template don´t have any type until

Re: ReturnType and Parameters of Templated function/method

2016-10-13 Thread Ali Çehreli via Digitalmars-d-learn
On 10/13/2016 07:19 AM, Patric Dexheimer wrote: There is a way to capture the return type/parameters of a templated function like: void add(T)(T t){} Parameters!add; Yes, i know that the template don´t have any type until explicitly coded like: Parameters!(add!int); Or another solution like

ReturnType and Parameters of Templated function/method

2016-10-13 Thread Patric Dexheimer via Digitalmars-d-learn
There is a way to capture the return type/parameters of a templated function like: void add(T)(T t){} Parameters!add; Yes, i know that the template don´t have any type until explicitly coded like: Parameters!(add!int); Or another solution like getting the string function declaration will