I'm wondering how compiler optimization handles the evaluation of parameters in case a function is an empty call. Have an example:
void function(const std::string& input) {}
std::string getInput()
{
// some magic here...
return "some_string";
}
int main()
{
function(getInput());
return 0;
}
In such case if function() is an empty call, will compiler optimize that in such way that the call to getInput() won't happen?