summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorKonstantin Käfer <mail@kkaefer.com>2015-05-08 11:34:46 +0200
committerKonstantin Käfer <mail@kkaefer.com>2015-05-08 11:34:46 +0200
commitbd8d10bab68cff8cdd7cebf2629a7fe6b20c08e5 (patch)
tree6fa5064be735746a1e825af767b465beb7e6c170 /src
parentfb984a22d191949fd7f998dbf1f746a9ee0a6724 (diff)
downloadqtlocation-mapboxgl-bd8d10bab68cff8cdd7cebf2629a7fe6b20c08e5.tar.gz
make DefaultFileRequest movable only
Diffstat (limited to 'src')
-rw-r--r--src/mbgl/storage/default_file_source.cpp2
-rw-r--r--src/mbgl/storage/default_file_source_impl.hpp8
2 files changed, 8 insertions, 2 deletions
diff --git a/src/mbgl/storage/default_file_source.cpp b/src/mbgl/storage/default_file_source.cpp
index 690a968812..cc7475d2f3 100644
--- a/src/mbgl/storage/default_file_source.cpp
+++ b/src/mbgl/storage/default_file_source.cpp
@@ -85,7 +85,7 @@ void DefaultFileSource::Impl::add(Request* req) {
return;
}
- request = &pending.emplace(resource, DefaultFileRequest(resource)).first->second;
+ request = &pending.emplace(resource, resource).first->second;
request->observers.insert(req);
if (cache) {
diff --git a/src/mbgl/storage/default_file_source_impl.hpp b/src/mbgl/storage/default_file_source_impl.hpp
index ed2d248d0a..3845014e97 100644
--- a/src/mbgl/storage/default_file_source_impl.hpp
+++ b/src/mbgl/storage/default_file_source_impl.hpp
@@ -19,8 +19,14 @@ struct DefaultFileRequest {
std::set<Request*> observers;
RequestBase* request = nullptr;
- DefaultFileRequest(const Resource& resource_)
+ inline DefaultFileRequest(const Resource& resource_)
: resource(resource_) {}
+
+ // Make it movable-only
+ DefaultFileRequest(const DefaultFileRequest&) = delete;
+ inline DefaultFileRequest(DefaultFileRequest&&) = default;
+ DefaultFileRequest& operator=(const DefaultFileRequest&) = delete;
+ inline DefaultFileRequest& operator=(DefaultFileRequest&&) = default;
};
class DefaultFileSource::Impl {