mirror of https://github.com/axmolengine/axmol.git
add std::move to Vector move constructor and move equal operator overloading function.
This commit is contained in:
parent
55270cecb4
commit
698cdc5591
|
@ -68,7 +68,7 @@ public:
|
||||||
Vector<T>(Vector<T>&& other)
|
Vector<T>(Vector<T>&& other)
|
||||||
{
|
{
|
||||||
CCLOGINFO("In the move constructor of Vector!");
|
CCLOGINFO("In the move constructor of Vector!");
|
||||||
_data = other._data;
|
_data = std::move(other._data);
|
||||||
}
|
}
|
||||||
|
|
||||||
Vector<T>& operator=(const Vector<T>& other)
|
Vector<T>& operator=(const Vector<T>& other)
|
||||||
|
@ -83,7 +83,7 @@ public:
|
||||||
Vector<T>& operator=(Vector<T>&& other)
|
Vector<T>& operator=(Vector<T>&& other)
|
||||||
{
|
{
|
||||||
CCLOGINFO("In the move assignment operator!");
|
CCLOGINFO("In the move assignment operator!");
|
||||||
_data = other._data;
|
_data = std::move(other._data);
|
||||||
return *this;
|
return *this;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue