diff options
Diffstat (limited to 'include/private/SkTDArray.h')
-rw-r--r-- | include/private/SkTDArray.h | 15 |
1 files changed, 11 insertions, 4 deletions
diff --git a/include/private/SkTDArray.h b/include/private/SkTDArray.h index dd3212d0dd..c6bd4ffd37 100644 --- a/include/private/SkTDArray.h +++ b/include/private/SkTDArray.h @@ -13,6 +13,8 @@ #include "SkTo.h" #include "SkTypes.h" +#include <utility> + template <typename T> class SkTDArray { public: SkTDArray() : fArray(nullptr), fReserve(0), fCount(0) {} @@ -67,10 +69,11 @@ public: return !(a == b); } - void swap(SkTDArray<T>& other) { - SkTSwap(fArray, other.fArray); - SkTSwap(fReserve, other.fReserve); - SkTSwap(fCount, other.fCount); + void swap(SkTDArray<T>& that) { + using std::swap; + swap(fArray, that.fArray); + swap(fReserve, that.fReserve); + swap(fCount, that.fCount); } bool isEmpty() const { return fCount == 0; } @@ -371,4 +374,8 @@ private: } }; +template <typename T> static inline void swap(SkTDArray<T>& a, SkTDArray<T>& b) { + a.swap(b); +} + #endif |