Forums
New posts
Search forums
Members
Current visitors
Log in
Register
What's new
Search
Search
Search titles only
By:
New posts
Search forums
Menu
Log in
Register
Install the app
Install
Forums
Archive
Archive
C++
Initializing a map...
JavaScript is disabled. For a better experience, please enable JavaScript in your browser before proceeding.
You are using an out of date browser. It may not display this or other websites correctly.
You should upgrade or use an
alternative browser
.
Reply to thread
Message
[QUOTE="Jeff Schwab, post: 3451569"] Right, but what's the relevance? I don't understand what you mean. I was pointing out that in: m[k] = v; The map first has to default-construct the value (assuming this is the first time the map entry has been accessed), then assign to it. One could instead check for the correct position of the value with lower_bound (I mistakenly said map::find), then use that iterator as a hint to insert the new value. This way, the value in the map can be copy-constructed in the first place, rather than default-constructed, then assigned. [/QUOTE]
Verification
Post reply
Forums
Archive
Archive
C++
Initializing a map...
Top