summaryrefslogtreecommitdiff
path: root/include/mbgl
diff options
context:
space:
mode:
authorMikhail Pozdnyakov <mikhail.pozdnyakov@mapbox.com>2019-01-15 15:43:10 +0200
committerMikhail Pozdnyakov <mikhail.pozdnyakov@mapbox.com>2019-01-15 22:29:08 +0200
commit577e6ee98af8c683ff4747b9a105c4a7ba3f7101 (patch)
treea280260634b82093d51273144d8a381ca28e3085 /include/mbgl
parent9ba0737e6a653cafec5d02982c06c31da970f6ca (diff)
downloadqtlocation-mapboxgl-577e6ee98af8c683ff4747b9a105c4a7ba3f7101.tar.gz
[core] Simplify mbgl::Immutable
Diffstat (limited to 'include/mbgl')
-rw-r--r--include/mbgl/util/immutable.hpp20
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(); }