GSP
Quick Navigator

Search Site

Unix VPS
A - Starter
B - Basic
C - Preferred
D - Commercial
MPS - Dedicated
Previous VPSs
* Sign Up! *

Support
Contact Us
Online Help
Handbooks
Domain Status
Man Pages

FAQ
Virtual Servers
Pricing
Billing
Technical

Network
Facilities
Connectivity
Topology Map

Miscellaneous
Server Agreement
Year 2038
Credits
 

USA Flag

 

 

Man Pages
std::experimental::ranges::exchange(3) C++ Standard Libary std::experimental::ranges::exchange(3)

std::experimental::ranges::exchange - std::experimental::ranges::exchange


Defined in header <experimental/ranges/utility>
template< MoveConstructible T, class U = T >


requires Assignable<T&, U> (ranges TS)


constexpr T exchange(T& obj, U&& new_val) noexcept(/* see below */);


Replaces the value of obj with new_value and returns the old value of obj, as if by


T old_value = std::move(obj);
obj = std::forward<U>(new_value);
return old_value;


obj - object whose value to replace
new_value - the value to assign to obj


The old value of obj


noexcept specification:
noexcept(std::is_nothrow_move_constructible<T>::value &&
std::is_nothrow_assignable<T&, U>::value)


This section is incomplete
Reason: no example


exchange replaces the argument with a new value and returns its previous value
(C++14) (function template)

2022.07.31 http://cppreference.com

Search for    or go to Top of page |  Section 3 |  Main Index

Powered by GSP Visit the GSP FreeBSD Man Page Interface.
Output converted with ManDoc.