Wrox Programmer Forums

Need to download code?

View our list of code downloads.

Go Back   Wrox Programmer Forums > C# and C > C++ and Visual C++ > BOOK: Professional C++, 3rd Edition
Password Reminder
| FAQ | Members List | Search | Today's Posts | Mark Forums Read
BOOK: Professional C++, 3rd Edition
This is the forum to discuss the Wrox book Professional C++, 3rd Edition by Marc Gregoire,; ISBN: 978-1-118-85805-9
Welcome to the p2p.wrox.com Forums.

You are currently viewing the BOOK: Professional C++, 3rd Edition section of the Wrox Programmer to Programmer discussions. This is a community of tens of thousands of software programmers and website developers including Wrox book authors and readers. As a guest, you can read any forum posting. By joining today you can post your own programming questions, respond to other developers’ questions, and eliminate the ads that are displayed to guests. Registration is fast, simple and absolutely free .
DRM-free e-books 300x50
Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old December 13th, 2016, 07:06 PM
Registered User
Points: 5, Level: 1
Points: 5, Level: 1 Points: 5, Level: 1 Points: 5, Level: 1
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
Join Date: Dec 2016
Posts: 1
Thanks: 0
Thanked 0 Times in 0 Posts
Default 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) ...
Reply With Quote

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are Off
Pingbacks are On
Refbacks are Off

Similar Threads
Thread Thread Starter Forum Replies Last Post
Ch 3: Create items in Which Task List ? EDGY BOOK: Workflow in SharePoint 2010: Real World Business Workflow Solutions 1 May 19th, 2014 01:28 PM
ToDo list in ch-2 Mounika BOOK: Professional Android Application Development ISBN: 978-0-470-34471-2 0 January 20th, 2012 03:26 AM
ch 8 "validate against inclusion in a list" nick_rasband@byu.net BOOK: Beginning Ruby on Rails 5 July 20th, 2010 07:02 PM
Ch 4 Todo List 2 - odd behavior EricTapia BOOK: Professional Android 2 Application Development 1 March 21st, 2010 03:22 AM
Type initializer Error Prakash001 Crystal Reports 1 February 14th, 2008 02:39 PM

All times are GMT -4. The time now is 10:48 AM.

Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
© 2013 John Wiley & Sons, Inc.