Go style selection statements "if (init; condition)" is by far my favorite upcoming C++17 feature. http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2016/p0305r1.html …
I see this being useful a lot. if( X* pX = GetX(); pX ) { /*use pX, stays in scope.*/} Esp. in a game engine w/ handles.
-
-
Interestingly, you can already do this! if(X* pX = GetX()) {/*use pX*/} The syntax just isn't as clear/obvious? Not sure the goal of if(;)
-
Crank up warnings, pretty sure any compiler warns about this. ; is there probably to make it clear what's intention and avoid this warning.
- Näytä vastaukset
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.