diff --git a/Source/Engine/Core/Types/Pair.h b/Source/Engine/Core/Types/Pair.h index d766aeff5..79e35599f 100644 --- a/Source/Engine/Core/Types/Pair.h +++ b/Source/Engine/Core/Types/Pair.h @@ -2,6 +2,7 @@ #pragma once +#include "Engine/Core/Templates.h" #include "Engine/Core/Collections/HashFunctions.h" /// @@ -45,41 +46,44 @@ public: /// /// Initializes a new instance of the class. /// - /// The key. - Pair(const T& key) - : First(key) + /// The other pair. + Pair(const Pair& other) + : First(other.First) + , Second(other.Second) { } /// /// Initializes a new instance of the class. /// - /// The other pair. - Pair(const Pair& p) - : First(p.First) - , Second(p.Second) - { - } - - /// - /// Initializes a new instance of the class. - /// - /// The other pair. - Pair(Pair* p) - : First(p->First) - , Second(p->Second) - { - } - - /// - /// Finalizes an instance of the class. - /// - ~Pair() + /// The other pair. + Pair(Pair&& other) noexcept + : First(MoveTemp(other.First)) + , Second(MoveTemp(other.Second)) { } public: + Pair& operator=(const Pair& other) + { + if (this == &other) + return *this; + First = other.First; + Second = other.Second; + return *this; + } + + Pair& operator=(Pair&& other) noexcept + { + if (this != &other) + { + First = MoveTemp(other.First); + Second = MoveTemp(other.Second); + } + return *this; + } + friend bool operator==(const Pair& a, const Pair& b) { return a.First == b.First && a.Second == b.Second;