I have a function:
static Bwah boo(){ Bwah bwah; return bwah; }
And the main function:
int main(){ Bwah boo = Assigner::boo(); cout << "got here.." << endl; }
The destructor in Bwah is called only once, after printing "received here". Is this a guarantee or is it a compiler optimization?
source share