Ch 7: Initializer-List Constructors example
The first example for Initializer-List Constructors doesn't seem right. Specifically, the two uses of the range for loop:
for (auto value : args) ...
for (auto value : mSequence) ...
As these are, the copy constructor is called and then the value is throw away, right?
Earlier in the page there is the NOTE: For performance reasons, it is best to pass objects by const reference instead.
Wouldn't it be better for the two range-for examples be const references?
for (const auto& value: args) ...
for (const auto& value : mSequence) ...
|