You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I almost always use auto (and I have a hard time with my line manager who opposes it with nonsensical reasons): we often don't need to spell out the type of local variables returned by functions, especially when they would be insanely verbose, plus, as you briefly explain at page 248, automatic type deduction avoids the implicit conversions we would have if we initialised with the wrong type.
However, the usage of auto at page 62 and later seem all but beautiful to me :-)
auto options = std::ifstream(filename);
...
auto key = std::string{};
auto value = std::string{};
Really? It's longer than
std::ifstream options{filename};
std::string key;
and we're not gaining anything, apart from a vague consistency in style, or are we trying to mimic Rust?
The text was updated successfully, but these errors were encountered:
Beauty is in the eye of the beholder.
I almost always use
auto
(and I have a hard time with my line manager who opposes it with nonsensical reasons): we often don't need to spell out the type of local variables returned by functions, especially when they would be insanely verbose, plus, as you briefly explain at page 248, automatic type deduction avoids the implicit conversions we would have if we initialised with the wrong type.However, the usage of
auto
at page 62 and later seem all but beautiful to me :-)Really? It's longer than
and we're not gaining anything, apart from a vague consistency in style, or are we trying to mimic Rust?
The text was updated successfully, but these errors were encountered: