Re: Check if function argument can be handled in CT

2019-04-24 Thread Mike Parker via Digitalmars-d-learn
On Wednesday, 24 April 2019 at 10:52:58 UTC, Andrey wrote: On Wednesday, 24 April 2019 at 08:28:06 UTC, Basile.B wrote: On Wednesday, 24 April 2019 at 07:53:47 UTC, Andrey wrote: I know about this template. Unfortunally, it doesn't work inside functions. void test(string arg1, string arg2)

Re: Check if function argument can be handled in CT

2019-04-24 Thread Andrey via Digitalmars-d-learn
On Wednesday, 24 April 2019 at 08:28:06 UTC, Basile.B wrote: On Wednesday, 24 April 2019 at 07:53:47 UTC, Andrey wrote: I know about this template. Unfortunally, it doesn't work inside functions. void test(string arg1, string arg2) { enum isKnown1 = is(typeof((){enum v = arg1;}));

Re: Check if function argument can be handled in CT

2019-04-24 Thread Basile.B via Digitalmars-d-learn
On Wednesday, 24 April 2019 at 07:53:47 UTC, Andrey wrote: Hi all, Do you know can we detect that some argument of a function can be handled in CT? For example: int value1 = 10; someFunction(value1); int value2 = getValueFromUserInput(); someFunction(value2); void someFunction(int arg) {

Check if function argument can be handled in CT

2019-04-24 Thread Andrey via Digitalmars-d-learn
Hi all, Do you know can we detect that some argument of a function can be handled in CT? For example: int value1 = 10; someFunction(value1); int value2 = getValueFromUserInput(); someFunction(value2); void someFunction(int arg) { static if(argCanBeHandledInCT(arg)) { // perform