This week I learned 26
This week I learned that assigning a constant reference to a temporary will extend the temporary’s lifetime. This is why const std::string &s = Foo();
works.
This week I learned that assigning a constant reference to a temporary will extend the temporary’s lifetime. This is why const std::string &s = Foo();
works.