-
Notifications
You must be signed in to change notification settings - Fork 1
Open
Description
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 :-)
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?
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels