how can i make swapping for 2 variables in more than 2 ways ??
rose_2
0
Junior Poster in Training
Recommended Answers
Jump to PostQuestion is confusing.. What do you mean "make swapping"?
There are many ways to swap two variables..
std::swap(variable_a, variable_b); //OR template<class T> void do_swap(T& a, T& b) { T temp = std::move(a); a = std::move(b); b = std::move(temp); } //OR template<typename T> void do_swap(T& a, T& b) …
All 3 Replies
Reply to this topic
Be a part of the DaniWeb community
We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.