|
|
|
|
|
by nickysielicki
714 days ago
|
|
The whole thing is wrong. Don’t put const references in your structs. Use std::reference_wrapper if you must. Edit: this response is a bit dismissive but honestly my main beef with this article is that its conclusion is just straight up wrong. Do not write your own constructors, do follow the rule of 5/3/0, and if you find yourself needing to hold a const reference, you should look out for whether you’re passing in an rval temporary… none of this is really scary. |
|