First of all, to explain what I'm trying to do:
void Foo(int &num, bool condition); Foo(x, x > 3);
This code would basically evaluate the bool condition before calling the function, and then pass a clear true or false. I am looking for a way to make this pass a condition, so I could do something like this:
void Foo(int &num, bool condition) { while(!condition) { num = std::rand(); } }
I know that there can be a workaround by passing the line containing the condition, and we will analyze the latter, and I am working on it now, but I consider it rather inefficient. The accepted answer will be the one who explains the solution in any other way next to where the line containing the condition is parsed, or the answer that explains that this way of passing the conditions is impossible.
Thanks in advance
source share