+ 1

What is move constructor?

what is move constructor, and what is use of that?

23rd May 2018, 6:25 AM
R V
R V - avatar
1 Respuesta
+ 12
If a class doesn't have any user-declared special member functions (save a default constructor), C++ declares its remaining five (or six) special member functions implicitly, including a move constructor and amove assignment operator. http://en.cppreference.com/w/cpp/language/move_constructor Use:- A trivial move constructor is a constructor that performs the same action as the trivialcopy constructor, that is, makes a copy of the object representation as if by std::memmove. All data types compatible with the C language (POD types) are trivially movable
23rd May 2018, 6:27 AM
Abhivarshini Maddala
Abhivarshini Maddala - avatar