P
Pallav singh
How can we justify that initializer list is better in performance
than assignment list in constructor of C++ ??
than assignment list in constructor of C++ ??
How can we justify that initializer list is better in performance
than assignment list in constructor of C++ ??
On Tue, 15 Jan 2008 22:51:15 -0800 (PST), Pallav singh
Why would we want to justify it? The C++ standard does not
specify or require such a thing.
An initializer list is the preferred way to initialize the
members in a constructor. It is the only possible way to
initialize reference members and constant members. So just
use initializer lists.
Why would we want to justify it? The C++ standard does not specify or
require such a thing.
On 2008-01-16 08:09, Jack Klein wrote:
No it does not, but it does guarantee some other things that
makes it very probably that using the initialiser-list if
slightly more efficient.
You can never get better performance by not using
initialisation-lists, but you can sometimes get the same
performance.
than assignment list in constructor of C++ ??
Want to reply to this thread or ask your own question?
You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.