Fix move semantic.
New class. --HG-- branch : develop
This commit is contained in:
parent
74bb3e4369
commit
54cb9fe0fb
|
@ -71,6 +71,21 @@ VBestSquare &VBestSquare::operator=(const VBestSquare &res)
|
|||
return *this;
|
||||
}
|
||||
|
||||
#ifdef Q_COMPILER_RVALUE_REFS
|
||||
//---------------------------------------------------------------------------------------------------------------------
|
||||
VBestSquare &VBestSquare::operator=(VBestSquare &&res) Q_DECL_NOTHROW
|
||||
{
|
||||
Swap(res);
|
||||
return *this;
|
||||
}
|
||||
#endif
|
||||
|
||||
//---------------------------------------------------------------------------------------------------------------------
|
||||
void VBestSquare::Swap(VBestSquare &res) Q_DECL_NOTHROW
|
||||
{
|
||||
std::swap(d, res.d);
|
||||
}
|
||||
|
||||
//---------------------------------------------------------------------------------------------------------------------
|
||||
void VBestSquare::NewResult(const VBestSquareResData &data)
|
||||
{
|
||||
|
|
|
@ -49,11 +49,10 @@ public:
|
|||
|
||||
VBestSquare &operator=(const VBestSquare &res);
|
||||
#ifdef Q_COMPILER_RVALUE_REFS
|
||||
VBestSquare &operator=(VBestSquare &&res) Q_DECL_NOTHROW { Swap(res); return *this; }
|
||||
VBestSquare &operator=(VBestSquare &&res) Q_DECL_NOTHROW;
|
||||
#endif
|
||||
|
||||
inline void Swap(VBestSquare &res) Q_DECL_NOTHROW
|
||||
{ std::swap(d, res.d); }
|
||||
void Swap(VBestSquare &res) Q_DECL_NOTHROW;
|
||||
|
||||
void NewResult(const VBestSquareResData &data);
|
||||
void NewResult(const VBestSquare &best);
|
||||
|
|
Loading…
Reference in New Issue
Block a user