Top "Swap" questions

Changing position of two items.

std::swap vs std::exchange vs swap operator

An implementation of std::swap might look like this: template <class T> void swap (T& a, T&…

c++ swap c++14
Benefits of a swap function?

Browsing through some C++ questions I have often seen comments that a STL-friendly class should implement a swap function (usually …

c++ stl swap
Swapping rows within the same pandas dataframe

I'm trying to swap the rows within the same DataFrame in pandas. I've tried running a = pd.DataFrame(data = [[1,2],[3,4]], index=…

python pandas dataframe rows swap
Finding the minimum number of swaps to convert one string to another, where the strings may have repeated characters

I was looking through a programming question, when the following question suddenly seemed related. How do you convert a string …

string algorithm swap
sql swap primary key values

is it possible to swap primary key values between two datasets? If so, how would one do that?

sql primary-key swap
iter_swap() versus swap() -- what's the difference?

MSDN says: swap should be used in preference to iter_swap, which was included in the C++ Standard for backward …

c++ swap
How to implement swap()?

Possible Duplicate: how to provide a swap function for my class? Every time I think I understand it, I see …

c++ swap
LINUX: How to lock the pages of a process in memory

I have a LINUX server running a process with a large memory footprint (some sort of a database engine). The …

linux swap
Is the copy and swap idiom still useful in C++11

I refer to this question: What is the copy-and-swap idiom? Effectively, the above answer leads to the following implementation: class …

c++ c++11 swap
Swap slices of Numpy arrays

I love the way python is handling swaps of variables: a, b, = b, a and I would like to use …

python multidimensional-array numpy swap