I am learning c++, and I just got to the object oriented chapter. I have a question about creating objects inside if statements.
The problem I\'m working on says
You can use an rvalue reference to bind in place to either constructed object.
struct Foo { Foo(int bar): bar(bar) {} int bar }; Foo&& f = condition ? Foo(4) : Foo(5); f.bar = 1000;