move operators works
This commit is contained in:
@@ -278,7 +278,7 @@ public:
|
||||
memmove((void*)(&(pid_data[pid_start])), (const void*)(&(pid_data[pid_start + 1])), index * sizeof(T));
|
||||
}
|
||||
PIINTROSPECTION_CONTAINER_USED(T, 1)
|
||||
elementNew(pid_data + pid_start + index, v);
|
||||
elementNew(pid_data + pid_start + index, std::move(v));
|
||||
return *this;
|
||||
}
|
||||
inline PIDeque<T> & insert(size_t index, const PIDeque<T> & other) {
|
||||
@@ -370,11 +370,11 @@ public:
|
||||
inline PIDeque<T> & push_back(T && v) {
|
||||
alloc(pid_size + 1, true);
|
||||
PIINTROSPECTION_CONTAINER_USED(T, 1);
|
||||
elementNew(pid_data + pid_start + pid_size - 1, v);
|
||||
elementNew(pid_data + pid_start + pid_size - 1, std::move(v));
|
||||
return *this;
|
||||
}
|
||||
inline PIDeque<T> & append(const T & v) {return push_back(v);}
|
||||
inline PIDeque<T> & append(T && v) {return push_back(v);}
|
||||
inline PIDeque<T> & append(T && v) {return push_back(std::move(v));}
|
||||
inline PIDeque<T> & append(const PIDeque<T> & t) {
|
||||
assert(&t != this);
|
||||
size_t ps = pid_size;
|
||||
@@ -383,7 +383,7 @@ public:
|
||||
return *this;
|
||||
}
|
||||
inline PIDeque<T> & operator <<(const T & v) {return push_back(v);}
|
||||
inline PIDeque<T> & operator <<(T && v) {return push_back(v);}
|
||||
inline PIDeque<T> & operator <<(T && v) {return push_back(std::move(v));}
|
||||
inline PIDeque<T> & operator <<(const PIDeque<T> & t) {return append(t);}
|
||||
|
||||
inline PIDeque<T> & push_front(const T & v) {insert(0, v); return *this;}
|
||||
@@ -451,7 +451,7 @@ private:
|
||||
}
|
||||
}
|
||||
inline void elementNew(T * to, const T & from) {new(to)T(from);}
|
||||
inline void elementNew(T * to, T && from) {piSwap(*to, from);}
|
||||
inline void elementNew(T * to, T && from) {new(to)T(std::move(from));}
|
||||
inline void elementDelete(T & from) {from.~T();}
|
||||
inline void dealloc() {
|
||||
if ((uchar*)pid_data != 0) free((uchar*)pid_data);
|
||||
|
||||
@@ -268,7 +268,7 @@ public:
|
||||
memmove((void*)(&(piv_data[index + 1])), (const void*)(&(piv_data[index])), os * sizeof(T));
|
||||
}
|
||||
PIINTROSPECTION_CONTAINER_USED(T, 1)
|
||||
elementNew(piv_data + index, v);
|
||||
elementNew(piv_data + index, std::move(v));
|
||||
return *this;
|
||||
}
|
||||
inline PIVector<T> & insert(size_t index, const PIVector<T> & other) {
|
||||
@@ -346,11 +346,11 @@ public:
|
||||
inline PIVector<T> & push_back(T && v) {
|
||||
alloc(piv_size + 1);
|
||||
PIINTROSPECTION_CONTAINER_USED(T, 1);
|
||||
elementNew(piv_data + piv_size - 1, v);
|
||||
elementNew(piv_data + piv_size - 1, std::move(v));
|
||||
return *this;
|
||||
}
|
||||
inline PIVector<T> & append(const T & v) {return push_back(v);}
|
||||
inline PIVector<T> & append(T && v) {return push_back(v);}
|
||||
inline PIVector<T> & append(T && v) {return push_back(std::move(v));}
|
||||
inline PIVector<T> & append(const PIVector<T> & other) {
|
||||
assert(&other != this);
|
||||
size_t ps = piv_size;
|
||||
@@ -359,7 +359,7 @@ public:
|
||||
return *this;
|
||||
}
|
||||
inline PIVector<T> & operator <<(const T & v) {return push_back(v);}
|
||||
inline PIVector<T> & operator <<(T && v) {return push_back(v);}
|
||||
inline PIVector<T> & operator <<(T && v) {return push_back(std::move(v));}
|
||||
inline PIVector<T> & operator <<(const PIVector<T> & other) {return append(other);}
|
||||
|
||||
inline PIVector<T> & push_front(const T & v) {insert(0, v); return *this;}
|
||||
@@ -436,7 +436,7 @@ private:
|
||||
}
|
||||
}
|
||||
inline void elementNew(T * to, const T & from) {new(to)T(from);}
|
||||
inline void elementNew(T * to, T && from) {piSwap(*to, from);}
|
||||
inline void elementNew(T * to, T && from) {new(to)T(std::move(from));}
|
||||
inline void elementDelete(T & from) {from.~T();}
|
||||
inline void dealloc() {
|
||||
if ((uchar*)piv_data != 0) free((uchar*)piv_data);
|
||||
|
||||
Reference in New Issue
Block a user