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 some calculations during compilation
}
else
{
// perform some calculations during runtime
}
}
Such thing would be good for code optimisation.
For example we pass some strings as arguments and in function
they are concatenated. So instead of concating them in RT (and
allocating memory) we can do all these actions in CT and get one
resulting string.