Closed wilhelmtell closed 10 years ago
Hi Matan,
Thanks for your suggested changes with their explanations. I agree with several of your observations, but not all.
size() > 0
over ! empty()
: agree.Thanks to @jwakely for his help.
cheers, Martin
A number of slight and not-so-slight fine-tunings. Some are performance:
'\n'
instead ofstd::endl
. If we don't want to force a flush it's better not to, for performance.std::move()
in initialization lists. In the case of rvalues passed at the call-site this leaves the compiler an opportunity to sidestep a copy.Some are expressiveness-related:
s/size() > 0/! empty()/
And one commit for idiomatic code: if a member of a copiable object is
const
then the object is not assignable. I think that usually (barring ... cases I can't think of off the top of my head) copying and assigning go together: when one is allowed so should the other be.