Skip to content

Search topics & cppreference

Search all study topics, concept maps, and 6,587 C++ and C reference pages.

std::experimental::function<R(Args...)>::swap

Exchanges the stored callable objects of *this and other.

NotebookLM
void swap( function& other );
(library fundamentals TS)

Exchanges the stored callable objects of *this and other.

The allocators of *this and other are not exchanged.

The behavior is undefined if *this->get_memory_resource() != *other.get_memory_resource().

(library fundamentals TS)
(until library fundamentals TS v3)

The behavior is undefined if this->get_allocator() != other.get_allocator().

(library fundamentals TS v3)

Parameters

other - function wrapper to exchange the stored callable object with

Return value

(none)

Content from this page on cppreference.com, licensed under CC-BY-SA 3.0 and GFDL. Modified: restyled, site navigation removed, code windows added. Offline snapshot of 9 February 2025.