lundi 25 juin 2018

c++ Complier optimisation in boolean conditional statement [duplicate]

This question already has an answer here:

bool fun() {
  cout<<"Run fun";
  return true;
}

int main() {

  if (true || fun()) {
   // ...
  }

//....
}

Hello! I wonder that is the function (fun) can be executed in any compiler and compiler optimization?

Aucun commentaire:

Enregistrer un commentaire