Been trying out C++ auto in a few different places and use cases to see how it feels and whether we want to use it more. Prevailing opinion in my team is clear: auto harms readability, comes with unwelcome gotchas, and is generally irritating. Very on brand for C++ though.
-
-
And for funzies, if the type returned is a const ref, auto&& will work, while auto& will not. Of course, const auto& would also work. The one thing I had to really work at was pointers. Those are by copy, even though in my head they are references.
Kiitos. Käytämme tätä aikajanasi parantamiseen. KumoaKumoa
-
-
-
auto c = std::copy(x); auto r = std::ref(x); … … … Yeah
-
Please stop
Keskustelun loppu
Uusi keskustelu -
Lataaminen näyttää kestävän hetken.
Twitter saattaa olla ruuhkautunut tai ongelma on muuten hetkellinen. Yritä uudelleen tai käy Twitterin tilasivulla saadaksesi lisätietoja.