menu
techminis

A naukri.com initiative

google-web-stories
Home

>

Programming News

>

Move Seman...
source image

Medium

2M

read

289

img
dot

Image Credit: Medium

Move Semantics in C++

  • Rvalue reference in C++ is a reference that binds only to temporary objects and is declared with double ampersands (&&).
  • Using move in C++ involves transferring resources instead of copying, reducing overhead by avoiding unnecessary memory allocations and copies.
  • The move process nullifies the original object's pointer to prevent access to the moved resource, resembling a shallow copy but with a crucial difference.
  • Move constructors in C++11 help transfer resources efficiently, avoiding issues like double deletion associated with shallow copying.

Read Full Article

like

17 Likes

For uninterrupted reading, download the app