forward_list::swap

Exchanges the elements of two forward lists.

void swap(forward_list& _Right);

Parameters

Parameter

Description

_Right

The forward list providing the elements to be exchanged.

Remarks

The member function swaps the controlled sequences between *this and _Right. If get_allocator() == _Right.get_allocator(), it does so in constant time, it throws no exceptions, and it invalidates no references, pointers, or iterators that designate elements in the two controlled sequences. Otherwise, it performs a number of element assignments and constructor calls proportional to the number of elements in the two controlled sequences.

Requirements

Header: <forward_list>

Namespace: std

See Also

Reference

forward_list Class

Other Resources

forward_list Members