The function is defined as static bool foo(const std::string& iVariable); belongs to Class A.
When I use if (A::foo(Var)), I found that the return value of A::foo(Var) will not change,I use it in many places, and Var is changed. So does it mean that the return value of A::foo(Var) will be fix, after the first time I use it? Thanks a lot!
The function is defined as static bool foo(const std::string& iVariable); belongs to Class A.
Share
Look at the documentation of A::foo and see if it says it ignores the argument after the first call. If it does say that, then you shouldn’t expect the return value to change. If it doesn’t say that, then you should expect the value to change in some way depending on the input and maybe other things that the documentation will hopefully tell you.
Of course the documentation could be wrong or misleading, in which case a look at the source code could clarify this.
If there is no documentation, I suggest you talk to the author of the code.
If you are the author, you may have some work to do.