Boost C++ Libraries of the most highly regarded and expertly designed C++ library projects in the world. Herb Sutter and Andrei Alexandrescu, C++ Coding Standards

This is the documentation for an old version of Boost. Click here to view this page for the latest version.


Installs a handler into the slot.

    typename CancellationHandler>
decay< CancellationHandler >::type & assign(
    CancellationHandler && handler);

Destroys any existing handler in the slot, then installs the new handler, constructing it as a decay-copy of the supplied handler.

The handler is a function object to be called when the signal is emitted. The signature of the handler must be

void handler(boost::asio::cancellation_type_t);


The handler to be installed.

Return Value

A reference to the newly installed handler.