Commit 88a4ebf4 authored by BRAMAS Berenger's avatar BRAMAS Berenger

Use move in the swap function of the quicksorts

parent 9b7d7536
......@@ -22,6 +22,7 @@
#include <cstdlib>
#include <cstring>
#include <vector> // For parallel without task
#include <utility> // For move
#include "FGlobal.hpp"
#include "FMemUtils.hpp"
......@@ -43,9 +44,9 @@ protected:
/** swap to value */
template <class NumType>
static inline void Swap(NumType& value, NumType& other){
NumType temp = value;
value = other;
other = temp;
const NumType temp = std::move(value);
value = std::move(other);
other = std::move(temp);
}
////////////////////////////////////////////////////////////
......
......@@ -21,6 +21,7 @@
#include "FLog.hpp"
#include <memory>
#include <utility>
template <class SortType, class CompareType, class IndexType>
class FQuickSortMpi : public FQuickSort< SortType, CompareType, IndexType> {
......@@ -38,9 +39,9 @@ class FQuickSortMpi : public FQuickSort< SortType, CompareType, IndexType> {
static void Swap(SortType& value, SortType& other){
SortType temp = value;
value = other;
other = temp;
const SortType temp = std::move(value);
value = std::move(other);
other = std::move(temp);
}
/* A local iteration of qs */
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment