diff options
author | Mikhail Pozdnyakov <mikhail.pozdnyakov@mapbox.com> | 2019-01-15 15:43:10 +0200 |
---|---|---|
committer | Mikhail Pozdnyakov <mikhail.pozdnyakov@mapbox.com> | 2019-01-15 22:29:08 +0200 |
commit | 577e6ee98af8c683ff4747b9a105c4a7ba3f7101 (patch) | |
tree | a280260634b82093d51273144d8a381ca28e3085 /include/mbgl | |
parent | 9ba0737e6a653cafec5d02982c06c31da970f6ca (diff) | |
download | qtlocation-mapboxgl-577e6ee98af8c683ff4747b9a105c4a7ba3f7101.tar.gz |
[core] Simplify mbgl::Immutable
Diffstat (limited to 'include/mbgl')
-rw-r--r-- | include/mbgl/util/immutable.hpp | 20 |
1 files changed, 5 insertions, 15 deletions
diff --git a/include/mbgl/util/immutable.hpp b/include/mbgl/util/immutable.hpp index b4117166dd..4d251df8d9 100644 --- a/include/mbgl/util/immutable.hpp +++ b/include/mbgl/util/immutable.hpp @@ -69,12 +69,11 @@ public: : ptr(std::const_pointer_cast<const S>(std::move(s.ptr))) {} template <class S> - Immutable(Immutable<S>&& s) + Immutable(Immutable<S> s) : ptr(std::move(s.ptr)) {} - template <class S> - Immutable(const Immutable<S>& s) - : ptr(s.ptr) {} + Immutable(Immutable&&) = default; + Immutable(const Immutable&) = default; template <class S> Immutable& operator=(Mutable<S>&& s) { @@ -82,17 +81,8 @@ public: return *this; } - template <class S> - Immutable& operator=(Immutable<S>&& s) { - ptr = std::move(s.ptr); - return *this; - } - - template <class S> - Immutable& operator=(const Immutable<S>& s) { - ptr = s.ptr; - return *this; - } + Immutable& operator=(Immutable&&) = default; + Immutable& operator=(const Immutable&) = default; const T* get() const { return ptr.get(); } const T* operator->() const { return ptr.get(); } |