C++ vector : emplace_back vs push_back

C++ vector has these two very special functions. vector push_back function and vector emplace_back function are…

Copy Constructor and Move Constructor: Test with vector

Copy constructor and move constructor are different. The Copy constructor creates a fresh copy of resources…

What is move constructor and why it take r-value?

Since, C++11, apart from existing compiler generated functions 2 more special functions are generated , these…

What is C++ reference collapsing, how it works?

With these c++ reference combinations, the compiler follows certain rules to collapse references to references and…

How std forward( ) converts to r-value in c++?

Just like, std::move( ), std::forward( ) also casts its argument (to R-value), however, unlike move( )…

Smart Pointer: understanding unique_ptr

C++ smart pointers: std::unique_ptr does everything which std::auto_ptr does, plus it also takes care of exclusive…

std move () : How this template function works?

The std::move( ) is a function template which perform static casts. The std::move( ) unconditionally casts…