reference_wrapper in C++


std::reference_wrapper in C++

std::reference_wrapper in C++

 In C++ the reference_wrapper is a class template that helps by wrapping a reference in a copy constructible and copy the assignable object. It can not take normal declare value, it has to be a reference.

std::reference_wrapper is a predefined class that acts or uses as a reference . This class allows the user to copy or assign value. We can use this class inside vector, list, or map.

Important point to know before using  reference_wrapper

  • include functional header file (#include <functional>

include the below at bottom of the Blog Post or Website

0 Comments