C++0x r-value references and move semantics

Loading...

Sign in or sign up now!
Alert icon
Upgrade to the latest Flash Player for improved playback performance. Upgrade now or more info.
620 views
Loading...
Alert icon
Sign in or sign up now!
Alert icon
There is no Interactive Transcript.

Uploaded by on May 31, 2011

Presentation about r-value references and move semantics in the new C++0x standard of C++ language.
In the presentation I talk about motivation for it and using and performance impact of it.

Category:

Science & Technology

Tags:

License:

Standard YouTube License

  • likes, 0 dislikes

Link to this comment:

Share to:
see all

All Comments (2)

Sign In or Sign Up now to post a comment!
  • @fortysixfish Thank you for question. Answer is: If your function is called as rvalue reference (RVO is not applied), C++ calls destructor as obvious on function's str object - but before destructor is called, str object is moved (stollen) to object from calling code - so then local str object is null or some garbish and it is fine to destruct ;) If you don't still understand me, feel free to ask me again :)

  • This was excellent, thank you! One question I have: If you have a function, std::string returnSomeString() { std::string str("Hello"); return str; } wouldn't a temporary be required since str goes out of block and has destructor called?

Loading...

Alert icon
0 / 00Unsaved Playlist Return to active list
    1. Your queue is empty. Add videos to your queue using this button:
      or sign in to load a different list.
    Loading...Loading...Saving...
    • Clear all videos from this list
    • Learn more