bsl::function::operator=

Copy-assign the target from rhs and return *this.

Synopsis

Declared in <bslstl_function.h>

bsl::function<PROTOTYPE>&
operator=(function const& rhs);

Description

Set the target of this object to a copy of the target (if any) held by the specified rhs object, destroy the target (if any) previously held by *this, and return *this. The result is equivalent to having constructed *this from rhs using the extended copy constructor with allocator this->get_allocator(). If an exception is thrown, *this is not modified (i.e., copy assignment provides the strong exception guarantee).

Return Value

reference providing modifiable access to this object

Parameters

NameDescription
rhsfunction whose target is copied into this object