summaryrefslogtreecommitdiff
path: root/include/mbgl/util
diff options
context:
space:
mode:
authorMikhail Pozdnyakov <mikhail.pozdnyakov@mapbox.com>2018-10-25 16:15:31 +0300
committerMikhail Pozdnyakov <mikhail.pozdnyakov@mapbox.com>2018-10-25 22:42:43 +0300
commit7a9461a8d439458b18656ecfb839923adc5f0e9b (patch)
tree5617367418dafc5b7b45c4ba7cca4b74f40200f3 /include/mbgl/util
parentfdd8b54900d963d01f9b643fa7edd9e988eb7785 (diff)
downloadqtlocation-mapboxgl-7a9461a8d439458b18656ecfb839923adc5f0e9b.tar.gz
Consolidate `style::Layer` properties API
The `style::Layer` class now exposes all the properties contained at `style::LayerImpl`. This allowed to drop `style::Layer::accept()` method usage, avoid the repeated generated code and thus save some binary size. This patch is a part of the layers modularization effort.
Diffstat (limited to 'include/mbgl/util')
-rw-r--r--include/mbgl/util/immutable.hpp6
1 files changed, 6 insertions, 0 deletions
diff --git a/include/mbgl/util/immutable.hpp b/include/mbgl/util/immutable.hpp
index eb26c0d282..b4117166dd 100644
--- a/include/mbgl/util/immutable.hpp
+++ b/include/mbgl/util/immutable.hpp
@@ -39,6 +39,7 @@ private:
template <class S> friend class Immutable;
template <class S, class... Args> friend Mutable<S> makeMutable(Args&&...);
+ template <class S, class U> friend Mutable<S> staticMutableCast(const Mutable<U>&);
};
template <class T, class... Args>
@@ -46,6 +47,11 @@ Mutable<T> makeMutable(Args&&... args) {
return Mutable<T>(std::make_shared<T>(std::forward<Args>(args)...));
}
+template <class S, class U>
+Mutable<S> staticMutableCast(const Mutable<U>& u) {
+ return Mutable<S>(std::static_pointer_cast<S>(u.ptr));
+}
+
/**
* `Immutable<T>` is a non-nullable shared reference to a `const T`. Construction requires
* a transfer of unique ownership from a `Mutable<T>`; once constructed it has the same behavior