cpp/utility/functional/reference wrapper

is a class template that wraps a reference in a copyable, assignable object. It is frequently used as a mechanism to store references inside standard containers (like std) which cannot normally hold references.

Specifically, is a  and  wrapper around a reference to object or reference to function of type. Instances of are objects (they can be copied or stored in containers) but they are implicitly convertible to, so that they can be used as arguments with the functions that take the underlying type by reference.

If the stored reference is, is callable with the same arguments.

Helper functions std and std are often used to generate objects.

is also used to pass objects by reference to std, the constructor of std, or the helper functions std and std.