I’m using an external library, and I have a class inheriting from another class with the next function
void IOCallback::Open(const char* filename, bool isOpen)
I need to modify the bool and I can’t modify the code to use it like reference.
is there anyway I can achieve this?
If you mean like this…
…then, well, you can’t. The function receives a copy of its argument. You are free to modify the argument from within the function, but you will not be able to do so in such a way that the caller would be able to see said modification.
I question the reasoning behind this request. If you wrote the code then you can modify it or add another overloaded version to do what you need. If you did not write the code and cannot modify it then it was never intended to mutate its argument in the first place, so what’s to be gained?