The solution to GotW #3 is now available:
GotW #3 Solution: Using the Standard Library (or, Temporaries Revisited) (updated for C++11/14)
by Herb Sutter
From the article:
With no other changes, simply using the standard
find
algorithm could do everything the range-basedfor
loop did to avoid needless temporaries (and questions about them) [...] and it further increases our level of abstraction.
Add a Comment
Comments are closed.