This is the mail archive of the
libstdc++@gcc.gnu.org
mailing list for the libstdc++ project.
Re: [RFC] libstdc++/9626 and std::vector constructors
Nathan Myers wrote:
They are not equivalent, but the standard explicitly allows specified
default-argument functions to be expanded into overloads. Wherever
practical, our library should do it. We should do it as much as
possible now, because it risks breaking the ABI to do it later.
Breaking up the interface very often creates optimization opportunities.
Not breaking it up may foreclose those opportunities until the next time
we choose to break the ABI.
In the case of the vector constructor, *not* overloading would mean that
you construct an extra copy of the object, unnecessarily.
Ah! I suspected that could have to do with optimizations...
Anyway, many thanks Nathan! As often happens, I learned _very_ interesting
things from your reply.
Paolo.