Chromium Code Reviews| Index: include/private/SkUniquePtr.h |
| diff --git a/include/private/SkUniquePtr.h b/include/private/SkUniquePtr.h |
| index 5d6e7226580aed5b176d7bd050cea8caa5bd5b78..46673da5c5c019e98faa3a65d60c5a0c9534d3b7 100644 |
| --- a/include/private/SkUniquePtr.h |
| +++ b/include/private/SkUniquePtr.h |
| @@ -9,7 +9,7 @@ |
| #define SkUniquePtr_DEFINED |
| #include "SkTLogic.h" |
| -#include "SkUtility.h" |
| +#include <utility> |
| namespace skstd { |
| @@ -51,7 +51,7 @@ private: |
| struct compressed_base : private B { |
| /*constexpr*/ compressed_base() : B() {} |
| /*constexpr*/ compressed_base(const B& b) : B(b) {} |
| - /*constexpr*/ compressed_base(const B&& b) : B(move(b)) {} |
| + /*constexpr*/ compressed_base(const B&& b) : B(std::move(b)) {} |
| /*constexpr*/ B& get() /*noexcept*/ { return *this; } |
| /*constexpr*/ B const& get() const /*noexcept*/ { return *this; } |
| void swap(compressed_base&) /*noexcept*/ { } |
| @@ -61,7 +61,7 @@ private: |
| B fb; |
| /*constexpr*/ compressed_base() : B() {} |
| /*constexpr*/ compressed_base(const B& b) : fb(b) {} |
| - /*constexpr*/ compressed_base(const B&& b) : fb(move(b)) {} |
| + /*constexpr*/ compressed_base(const B&& b) : fb(std::move(b)) {} |
| /*constexpr*/ B& get() /*noexcept*/ { return fb; } |
| /*constexpr*/ B const& get() const /*noexcept*/ { return fb; } |
| void swap(compressed_base& that) /*noexcept*/ { SkTSwap(fb, that.fB); } |
| @@ -75,7 +75,7 @@ private: |
| template <typename U1, typename U2, typename = enable_if_t< |
| is_convertible<U1, pointer>::value && is_convertible<U2, deleter_type>::value |
| >> /*constexpr*/ compressed_data(U1&& ptr, U2&& d) |
| - : compressed_base<deleter_type>(skstd::forward<U2>(d)), fPtr(skstd::forward<U1>(ptr)) {} |
| + : compressed_base<deleter_type>(std::forward<U2>(d)), fPtr(std::forward<U1>(ptr)) {} |
| /*constexpr*/ pointer& getPointer() /*noexcept*/ { return fPtr; } |
| /*constexpr*/ pointer const& getPointer() const /*noexcept*/ { return fPtr; } |
| /*constexpr*/ deleter_type& getDeleter() /*noexcept*/ { |
| @@ -96,7 +96,7 @@ public: |
| static_assert(!is_pointer<deleter_type>::value, "Deleter is nullptr function pointer!"); |
| } |
| - /*constexpr*/ unique_ptr(skstd::nullptr_t) /*noexcept*/ : unique_ptr() { } |
| + /*constexpr*/ unique_ptr(std::nullptr_t) /*noexcept*/ : unique_ptr() { } |
|
bungeman-skia
2016/01/05 18:54:43
std::nullptr_t is provided by <cstddef>
bungeman-skia
2016/01/05 18:59:41
Done.
|
| explicit unique_ptr(pointer ptr) /*noexcept*/ : data(ptr, deleter_type()) { |
| static_assert(!is_pointer<deleter_type>::value, "Deleter is nullptr function pointer!"); |
| @@ -108,7 +108,7 @@ public: |
| {} |
| unique_ptr(pointer ptr, remove_reference_t<deleter_type>&& d) /*noexcept*/ |
| - : data(move(ptr), move(d)) |
| + : data(std::move(ptr), std::move(d)) |
| { |
| static_assert(!is_reference<deleter_type>::value, |
| "Binding an rvalue reference deleter as an lvalue reference deleter is not allowed."); |
| @@ -116,7 +116,7 @@ public: |
| unique_ptr(unique_ptr&& that) /*noexcept*/ |
| - : data(that.release(), forward<deleter_type>(that.get_deleter())) |
| + : data(that.release(), std::forward<deleter_type>(that.get_deleter())) |
| {} |
| template <typename U, typename ThatD, typename = enable_if_t< |
| @@ -124,7 +124,7 @@ public: |
| !is_array<U>::value && |
| conditional_t<is_reference<D>::value, is_same<ThatD, D>, is_convertible<ThatD, D>>::value>> |
| unique_ptr(unique_ptr<U, ThatD>&& that) /*noexcept*/ |
| - : data(that.release(), forward<ThatD>(that.get_deleter())) |
| + : data(that.release(), std::forward<ThatD>(that.get_deleter())) |
| {} |
| ~unique_ptr() /*noexcept*/ { |
| @@ -137,7 +137,7 @@ public: |
| unique_ptr& operator=(unique_ptr&& that) /*noexcept*/ { |
| reset(that.release()); |
| - get_deleter() = forward<deleter_type>(that.get_deleter()); |
| + get_deleter() = std::forward<deleter_type>(that.get_deleter()); |
| return *this; |
| } |
| @@ -146,11 +146,11 @@ public: |
| !is_array<U>::value, |
| unique_ptr&> operator=(unique_ptr<U, ThatD>&& that) /*noexcept*/ { |
| reset(that.release()); |
| - get_deleter() = forward<ThatD>(that.get_deleter()); |
| + get_deleter() = std::forward<ThatD>(that.get_deleter()); |
| return *this; |
| } |
| - unique_ptr& operator=(skstd::nullptr_t) /*noexcept*/ { |
| + unique_ptr& operator=(std::nullptr_t) /*noexcept*/ { |
| reset(); |
| return *this; |
| } |
| @@ -221,7 +221,7 @@ private: |
| struct compressed_base : private B { |
| /*constexpr*/ compressed_base() : B() {} |
| /*constexpr*/ compressed_base(const B& b) : B(b) {} |
| - /*constexpr*/ compressed_base(const B&& b) : B(move(b)) {} |
| + /*constexpr*/ compressed_base(const B&& b) : B(std::move(b)) {} |
| /*constexpr*/ B& get() /*noexcept*/ { return *this; } |
| /*constexpr*/ B const& get() const /*noexcept*/ { return *this; } |
| void swap(compressed_base&) /*noexcept*/ { } |
| @@ -231,7 +231,7 @@ private: |
| B fb; |
| /*constexpr*/ compressed_base() : B() {} |
| /*constexpr*/ compressed_base(const B& b) : fb(b) {} |
| - /*constexpr*/ compressed_base(const B&& b) : fb(move(b)) {} |
| + /*constexpr*/ compressed_base(const B&& b) : fb(std::move(b)) {} |
| /*constexpr*/ B& get() /*noexcept*/ { return fb; } |
| /*constexpr*/ B const& get() const /*noexcept*/ { return fb; } |
| void swap(compressed_base& that) /*noexcept*/ { SkTSwap(fb, that.fB); } |
| @@ -245,7 +245,7 @@ private: |
| template <typename U1, typename U2, typename = enable_if_t< |
| is_convertible<U1, pointer>::value && is_convertible<U2, deleter_type>::value |
| >> /*constexpr*/ compressed_data(U1&& ptr, U2&& d) |
| - : compressed_base<deleter_type>(skstd::forward<U2>(d)), fPtr(skstd::forward<U1>(ptr)) {} |
| + : compressed_base<deleter_type>(std::forward<U2>(d)), fPtr(std::forward<U1>(ptr)) {} |
| /*constexpr*/ pointer& getPointer() /*noexcept*/ { return fPtr; } |
| /*constexpr*/ pointer const& getPointer() const /*noexcept*/ { return fPtr; } |
| /*constexpr*/ deleter_type& getDeleter() /*noexcept*/ { |
| @@ -266,7 +266,7 @@ public: |
| static_assert(!is_pointer<deleter_type>::value, "Deleter is nullptr function pointer!"); |
| } |
| - /*constexpr*/ unique_ptr(skstd::nullptr_t) /*noexcept*/ : unique_ptr() { } |
| + /*constexpr*/ unique_ptr(std::nullptr_t) /*noexcept*/ : unique_ptr() { } |
| explicit unique_ptr(pointer ptr) /*noexcept*/ : data(ptr, deleter_type()) { |
| static_assert(!is_pointer<deleter_type>::value, "Deleter is nullptr function pointer!"); |
| @@ -278,14 +278,14 @@ public: |
| {} |
| unique_ptr(pointer ptr, remove_reference_t<deleter_type>&& d) /*noexcept*/ |
| - : data(move(ptr), move(d)) |
| + : data(std::move(ptr), std::move(d)) |
| { |
| static_assert(!is_reference<deleter_type>::value, |
| "Binding an rvalue reference deleter as an lvalue reference deleter is not allowed."); |
| } |
| unique_ptr(unique_ptr&& that) /*noexcept*/ |
| - : data(that.release(), forward<deleter_type>(that.get_deleter())) |
| + : data(that.release(), std::forward<deleter_type>(that.get_deleter())) |
| {} |
| ~unique_ptr() { |
| @@ -298,11 +298,11 @@ public: |
| unique_ptr& operator=(unique_ptr&& that) /*noexcept*/ { |
| reset(that.release()); |
| - get_deleter() = forward<deleter_type>(that.get_deleter()); |
| + get_deleter() = std::forward<deleter_type>(that.get_deleter()); |
| return *this; |
| } |
| - unique_ptr& operator=(skstd::nullptr_t) /*noexcept*/ { |
| + unique_ptr& operator=(std::nullptr_t) /*noexcept*/ { |
| reset(); |
| return *this; |
| } |
| @@ -363,13 +363,13 @@ inline bool operator==(const unique_ptr<T, D>& a, const unique_ptr<U, ThatD>& b) |
| } |
| template <typename T, typename D> |
| -inline bool operator==(const unique_ptr<T, D>& a, skstd::nullptr_t) /*noexcept*/ { |
| +inline bool operator==(const unique_ptr<T, D>& a, std::nullptr_t) /*noexcept*/ { |
| //return !a; |
| return !a.is_attached(); |
| } |
| template <typename T, typename D> |
| -inline bool operator==(skstd::nullptr_t, const unique_ptr<T, D>& b) /*noexcept*/ { |
| +inline bool operator==(std::nullptr_t, const unique_ptr<T, D>& b) /*noexcept*/ { |
| //return !b; |
| return !b.is_attached(); |
| } |
| @@ -380,13 +380,13 @@ inline bool operator!=(const unique_ptr<T, D>& a, const unique_ptr<U, ThatD>& b) |
| } |
| template <typename T, typename D> |
| -inline bool operator!=(const unique_ptr<T, D>& a, skstd::nullptr_t) /*noexcept*/ { |
| +inline bool operator!=(const unique_ptr<T, D>& a, std::nullptr_t) /*noexcept*/ { |
| //return (bool)a; |
| return a.is_attached(); |
| } |
| template <typename T, typename D> |
| -inline bool operator!=(skstd::nullptr_t, const unique_ptr<T, D>& b) /*noexcept*/ { |
| +inline bool operator!=(std::nullptr_t, const unique_ptr<T, D>& b) /*noexcept*/ { |
| //return (bool)b; |
| return b.is_attached(); |
| } |