I read this article from D. Kalev this morning about the new c++11 feature \"defaulted and deleted functions\", and can\'t understand the part about performance, namely:
You ask, how is it that
class C { C() = default; };
can be more efficient than
class C { C(){} };
Well, both constructors do nothing, so it's meaningless to talk about efficiency for that example.
But more generally, in e.g. a copy constructor one can imagine that copying one POD item at a time will not be recognized as optimizable by simple optimizer, whereas with automatic generation it might just do a memcpy
. Who knows. It's a Quality of Implementation issue, and I can easily imagine also the opposite.
So, measure, if it matters.
Cheers & hth.,