The solution to the latest GotW problem is now available:
GotW #94 Solution: AAA Style (Almost Always Auto)
by Herb Sutter
From the article:
4. When declaring a new local variable
x, what advantages are there to declaring it usingautoand one of the two following syntaxes:(a)
auto x = init;when you don’t need to commit to a specific type? (Note: The expressioninitmight include calling a helper that performs partial type adjustment, such asas_signed, while still not committing to a specific type.)(b)
auto x = type{ init };when you do want to commit to a specific type by naming a type?

Add a Comment
Comments are closed.