summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKonstantin Käfer <mail@kkaefer.com>2015-05-26 15:18:27 +0200
committerKonstantin Käfer <mail@kkaefer.com>2015-05-26 17:57:38 +0200
commitf4707f72e0ce7f1c40337c72ae5c0c0c8ef0efed (patch)
tree31102ca2b739d2b21fcfc231585830969f2b4fa4
parentfdf6026e6249f99b260f15ec672a35c7e9db950d (diff)
downloadqtlocation-mapboxgl-f4707f72e0ce7f1c40337c72ae5c0c0c8ef0efed.tar.gz
Replace mbgl::util::make_unique<> with std::make_unique<>
-rw-r--r--android/cpp/native_map_view.cpp3
-rw-r--r--bin/render.cpp1
-rw-r--r--include/mbgl/platform/default/image_reader.hpp2
-rw-r--r--include/mbgl/platform/log.hpp1
-rw-r--r--include/mbgl/storage/file_source.hpp1
-rw-r--r--include/mbgl/util/std.hpp23
-rw-r--r--linux/main.cpp3
-rw-r--r--platform/darwin/http_request_nsurl.mm9
-rw-r--r--platform/darwin/image.mm3
-rw-r--r--platform/default/asset_request_fs.cpp9
-rw-r--r--platform/default/asset_request_zip.cpp7
-rw-r--r--platform/default/headless_view.cpp7
-rw-r--r--platform/default/http_request_curl.cpp10
-rw-r--r--platform/default/image.cpp3
-rw-r--r--platform/default/image_reader.cpp4
-rw-r--r--platform/default/sqlite_cache.cpp16
-rw-r--r--src/mbgl/geometry/glyph_atlas.cpp4
-rw-r--r--src/mbgl/geometry/line_atlas.cpp3
-rw-r--r--src/mbgl/geometry/sprite_atlas.cpp2
-rw-r--r--src/mbgl/map/annotation.cpp5
-rw-r--r--src/mbgl/map/annotation.hpp1
-rw-r--r--src/mbgl/map/map.cpp5
-rw-r--r--src/mbgl/map/map_context.cpp19
-rw-r--r--src/mbgl/map/resource_loader.cpp2
-rw-r--r--src/mbgl/map/source.cpp3
-rw-r--r--src/mbgl/map/sprite.cpp3
-rw-r--r--src/mbgl/map/tile_parser.cpp7
-rw-r--r--src/mbgl/map/transform.cpp1
-rw-r--r--src/mbgl/map/vector_tile_data.cpp3
-rw-r--r--src/mbgl/renderer/fill_bucket.cpp5
-rw-r--r--src/mbgl/renderer/line_bucket.cpp3
-rw-r--r--src/mbgl/renderer/painter.cpp25
-rw-r--r--src/mbgl/renderer/painter_fill.cpp1
-rw-r--r--src/mbgl/renderer/painter_raster.cpp1
-rw-r--r--src/mbgl/renderer/symbol_bucket.cpp3
-rw-r--r--src/mbgl/shader/shader.cpp6
-rw-r--r--src/mbgl/storage/default_file_source.cpp2
-rw-r--r--src/mbgl/storage/request.cpp5
-rw-r--r--src/mbgl/style/style.cpp3
-rw-r--r--src/mbgl/style/style_parser.cpp1
-rw-r--r--src/mbgl/text/glyph_store.cpp13
-rw-r--r--src/mbgl/util/raster.cpp3
-rw-r--r--src/mbgl/util/run_loop.hpp3
-rw-r--r--src/mbgl/util/worker.cpp4
-rw-r--r--test/api/repeated_render.cpp2
-rw-r--r--test/api/set_style.cpp2
-rw-r--r--test/headless/headless.cpp1
-rw-r--r--test/miscellaneous/bilinear.cpp3
-rw-r--r--test/miscellaneous/clip_ids.cpp1
-rw-r--r--test/resources/mock_file_source.cpp2
-rw-r--r--test/resources/mock_file_source.hpp1
-rw-r--r--test/resources/resource_loader.cpp16
-rw-r--r--test/storage/database.cpp22
53 files changed, 115 insertions, 173 deletions
diff --git a/android/cpp/native_map_view.cpp b/android/cpp/native_map_view.cpp
index 03530aefff..1d25442a55 100644
--- a/android/cpp/native_map_view.cpp
+++ b/android/cpp/native_map_view.cpp
@@ -15,7 +15,6 @@
#include <mbgl/platform/event.hpp>
#include <mbgl/platform/log.hpp>
#include <mbgl/platform/gl.hpp>
-#include <mbgl/util/std.hpp>
namespace mbgl {
namespace android {
@@ -214,7 +213,7 @@ void NativeMapView::initializeDisplay() {
throw new std::runtime_error("eglChooseConfig() failed");
}
- const std::unique_ptr<EGLConfig[]> configs = mbgl::util::make_unique<EGLConfig[]>(numConfigs);
+ const auto configs = std::make_unique<EGLConfig[]>(numConfigs);
if (!eglChooseConfig(display, configAttribs, configs.get(), numConfigs, &numConfigs)) {
mbgl::Log::Error(mbgl::Event::OpenGL, "eglChooseConfig() returned error %d", eglGetError());
throw new std::runtime_error("eglChooseConfig() failed");
diff --git a/bin/render.cpp b/bin/render.cpp
index 65cc2e8f43..5ae83c1d48 100644
--- a/bin/render.cpp
+++ b/bin/render.cpp
@@ -1,7 +1,6 @@
#include <mbgl/map/map.hpp>
#include <mbgl/map/still_image.hpp>
#include <mbgl/util/image.hpp>
-#include <mbgl/util/std.hpp>
#include <mbgl/util/io.hpp>
#include <mbgl/platform/default/headless_view.hpp>
diff --git a/include/mbgl/platform/default/image_reader.hpp b/include/mbgl/platform/default/image_reader.hpp
index 985e4874cd..52a67a2830 100644
--- a/include/mbgl/platform/default/image_reader.hpp
+++ b/include/mbgl/platform/default/image_reader.hpp
@@ -1,11 +1,11 @@
#ifndef MBGL_UTIL_IMAGE_READER_HPP
#define MBGL_UTIL_IMAGE_READER_HPP
-#include <mbgl/util/std.hpp>
#include <mbgl/util/noncopyable.hpp>
// stl
#include <stdexcept>
#include <string>
+#include <memory>
namespace mbgl { namespace util {
diff --git a/include/mbgl/platform/log.hpp b/include/mbgl/platform/log.hpp
index d6f3cd1ab4..86a8cdbef1 100644
--- a/include/mbgl/platform/log.hpp
+++ b/include/mbgl/platform/log.hpp
@@ -3,7 +3,6 @@
#include <mbgl/platform/event.hpp>
-#include <mbgl/util/std.hpp>
#include <mbgl/util/noncopyable.hpp>
#include <memory>
diff --git a/include/mbgl/storage/file_source.hpp b/include/mbgl/storage/file_source.hpp
index 7c6e578a9a..3b19e00788 100644
--- a/include/mbgl/storage/file_source.hpp
+++ b/include/mbgl/storage/file_source.hpp
@@ -5,7 +5,6 @@
#include "resource.hpp"
#include <mbgl/util/noncopyable.hpp>
-#include <mbgl/util/std.hpp>
#include <mbgl/util/util.hpp>
#include <functional>
diff --git a/include/mbgl/util/std.hpp b/include/mbgl/util/std.hpp
index e64820de47..0e2d3346bf 100644
--- a/include/mbgl/util/std.hpp
+++ b/include/mbgl/util/std.hpp
@@ -8,29 +8,6 @@
namespace mbgl {
namespace util {
-// C++14 backfill based on http://llvm.org/svn/llvm-project/libcxx/trunk/include/memory
-
-namespace detail {
-template<class T> struct unique_type { typedef ::std::unique_ptr<T> single; };
-template<class T> struct unique_type<T[]> { typedef ::std::unique_ptr<T[]> unknown_bound; };
-template<class T, size_t size> struct unique_type<T[size]> { typedef void known_bound; };
-}
-
-template<class T, class... Args>
-typename detail::unique_type<T>::single make_unique(Args&&... args) {
- return ::std::unique_ptr<T>(new T(::std::forward<Args>(args)...));
-}
-
-template<class T>
-typename detail::unique_type<T>::unknown_bound make_unique(size_t size) {
- return ::std::unique_ptr<T>(new typename ::std::remove_extent<T>::type[size]());
-}
-
-template<class T, class... Args>
-typename detail::unique_type<T>::known_bound make_unique(Args&&...) = delete;
-
-
-
template <typename Container, typename ForwardIterator, typename Predicate>
void erase_if(Container &container, ForwardIterator it, const ForwardIterator end, Predicate pred) {
while (it != end) {
diff --git a/linux/main.cpp b/linux/main.cpp
index 558f95dbed..9145b180f4 100644
--- a/linux/main.cpp
+++ b/linux/main.cpp
@@ -1,6 +1,5 @@
#include <mbgl/mbgl.hpp>
#include "../platform/default/default_styles.hpp"
-#include <mbgl/util/std.hpp>
#include <mbgl/util/uv.hpp>
#include <mbgl/platform/log.hpp>
#include <mbgl/platform/platform.hpp>
@@ -66,7 +65,7 @@ int main(int argc, char *argv[]) {
sigIntHandler.sa_flags = 0;
sigaction(SIGINT, &sigIntHandler, NULL);
- view = mbgl::util::make_unique<GLFWView>();
+ view = std::make_unique<GLFWView>();
mbgl::SQLiteCache cache("/tmp/mbgl-cache.db");
mbgl::DefaultFileSource fileSource(&cache);
diff --git a/platform/darwin/http_request_nsurl.mm b/platform/darwin/http_request_nsurl.mm
index ad16a69acf..207c33b23c 100644
--- a/platform/darwin/http_request_nsurl.mm
+++ b/platform/darwin/http_request_nsurl.mm
@@ -2,7 +2,6 @@
#include <mbgl/storage/resource.hpp>
#include <mbgl/storage/response.hpp>
-#include <mbgl/util/std.hpp>
#include <mbgl/util/time.hpp>
#include <mbgl/util/parsedate.h>
@@ -250,7 +249,7 @@ void HTTPRequest::handleResult(NSData *data, NSURLResponse *res, NSError *error)
} else {
// TODO: Use different codes for host not found, timeout, invalid URL etc.
// These can be categorized in temporary and permanent errors.
- response = util::make_unique<Response>();
+ response = std::make_unique<Response>();
response->status = Response::Error;
response->message = [[error localizedDescription] UTF8String];
@@ -282,7 +281,7 @@ void HTTPRequest::handleResult(NSData *data, NSURLResponse *res, NSError *error)
} else if ([res isKindOfClass:[NSHTTPURLResponse class]]) {
const long responseCode = [(NSHTTPURLResponse *)res statusCode];
- response = util::make_unique<Response>();
+ response = std::make_unique<Response>();
response->data = {(const char *)[data bytes], [data length]};
NSDictionary *headers = [(NSHTTPURLResponse *)res allHeaderFields];
@@ -338,7 +337,7 @@ void HTTPRequest::handleResult(NSData *data, NSURLResponse *res, NSError *error)
} else {
// This should never happen.
status = ResponseStatus::PermanentError;
- response = util::make_unique<Response>();
+ response = std::make_unique<Response>();
response->status = Response::Error;
response->message = "response class is not NSHTTPURLResponse";
}
@@ -364,7 +363,7 @@ void HTTPRequest::retry() {
}
std::unique_ptr<HTTPContext> HTTPContext::createContext(uv_loop_t* loop) {
- return util::make_unique<HTTPNSURLContext>(loop);
+ return std::make_unique<HTTPNSURLContext>(loop);
}
}
diff --git a/platform/darwin/image.mm b/platform/darwin/image.mm
index a9044774dc..f6a8a6783c 100644
--- a/platform/darwin/image.mm
+++ b/platform/darwin/image.mm
@@ -1,5 +1,4 @@
#include <mbgl/util/image.hpp>
-#include <mbgl/util/std.hpp>
#import <ImageIO/ImageIO.h>
@@ -98,7 +97,7 @@ Image::Image(const std::string &source_data) {
height = uint32_t(CGImageGetHeight(image));
CGRect rect = {{ 0, 0 }, { static_cast<CGFloat>(width), static_cast<CGFloat>(height) }};
- img = util::make_unique<char[]>(width * height * 4);
+ img = std::make_unique<char[]>(width * height * 4);
CGContextRef context = CGBitmapContextCreate(img.get(), width, height, 8, width * 4,
color_space, kCGImageAlphaPremultipliedLast);
if (!context) {
diff --git a/platform/default/asset_request_fs.cpp b/platform/default/asset_request_fs.cpp
index 9dae2e8a9c..04f85fbc3d 100644
--- a/platform/default/asset_request_fs.cpp
+++ b/platform/default/asset_request_fs.cpp
@@ -1,7 +1,6 @@
#include <mbgl/storage/asset_context.hpp>
#include <mbgl/storage/resource.hpp>
#include <mbgl/storage/response.hpp>
-#include <mbgl/util/std.hpp>
#include <mbgl/util/util.hpp>
#include <mbgl/util/url.hpp>
#include <mbgl/util/uv.hpp>
@@ -114,7 +113,7 @@ void AssetRequest::fileStated(uv_fs_t *req) {
if (stat->st_size > std::numeric_limits<int>::max()) {
// File is too large for us to open this way because uv_buf's only support unsigned
// ints as maximum size.
- auto response = util::make_unique<Response>();
+ auto response = std::make_unique<Response>();
response->status = Response::Error;
#if UV_VERSION_MAJOR == 0 && UV_VERSION_MINOR <= 10
response->message = uv_strerror(uv_err_t {UV_EFBIG, 0});
@@ -126,7 +125,7 @@ void AssetRequest::fileStated(uv_fs_t *req) {
uv_fs_req_cleanup(req);
uv_fs_close(req->loop, req, self->fd, fileClosed);
} else {
- self->response = util::make_unique<Response>();
+ self->response = std::make_unique<Response>();
#ifdef __APPLE__
self->response->modified = stat->st_mtimespec.tv_sec;
#else
@@ -184,7 +183,7 @@ void AssetRequest::notifyError(uv_fs_t *req) {
MBGL_VERIFY_THREAD(self->tid);
if (req->result < 0 && !self->canceled && req->result != UV_ECANCELED) {
- auto response = util::make_unique<Response>();
+ auto response = std::make_unique<Response>();
response->status = Response::Error;
response->message = uv::getFileRequestError(req);
self->notify(std::move(response), FileCache::Hint::No);
@@ -208,7 +207,7 @@ void AssetRequest::cancel() {
}
std::unique_ptr<AssetContext> AssetContext::createContext(uv_loop_t*) {
- return util::make_unique<AssetFSContext>();
+ return std::make_unique<AssetFSContext>();
}
}
diff --git a/platform/default/asset_request_zip.cpp b/platform/default/asset_request_zip.cpp
index 7666000d00..7fd93c55d1 100644
--- a/platform/default/asset_request_zip.cpp
+++ b/platform/default/asset_request_zip.cpp
@@ -3,7 +3,6 @@
#include <mbgl/storage/resource.hpp>
#include <mbgl/storage/response.hpp>
#include <mbgl/platform/log.hpp>
-#include <mbgl/util/std.hpp>
#include <mbgl/util/util.hpp>
#include <mbgl/util/uv.hpp>
@@ -178,7 +177,7 @@ void AssetRequest::fileStated(uv_zip_t *zip) {
notifyError("Could not determine file size in zip file");
cleanup(zip);
} else {
- response = util::make_unique<Response>();
+ response = std::make_unique<Response>();
// Allocate the space for reading the data.
response->data.resize(zip->stat->size);
@@ -247,7 +246,7 @@ void AssetRequest::notifyError(const char *message) {
MBGL_VERIFY_THREAD(tid);
if (!cancelled) {
- response = util::make_unique<Response>();
+ response = std::make_unique<Response>();
response->status = Response::Error;
response->message = message;
notify(std::move(response), FileCache::Hint::No);
@@ -261,7 +260,7 @@ void AssetRequest::cancel() {
}
std::unique_ptr<AssetContext> AssetContext::createContext(uv_loop_t* loop) {
- return util::make_unique<AssetZipContext>(loop);
+ return std::make_unique<AssetZipContext>(loop);
}
}
diff --git a/platform/default/headless_view.cpp b/platform/default/headless_view.cpp
index aa07706d84..0f00c7563d 100644
--- a/platform/default/headless_view.cpp
+++ b/platform/default/headless_view.cpp
@@ -5,7 +5,6 @@
#include <mbgl/map/still_image.hpp>
-#include <mbgl/util/std.hpp>
#include <stdexcept>
#include <sstream>
@@ -172,15 +171,15 @@ std::unique_ptr<StillImage> HeadlessView::readStillImage() {
const unsigned int w = dimensions.pixelWidth();
const unsigned int h = dimensions.pixelHeight();
- auto image = util::make_unique<StillImage>();
+ auto image = std::make_unique<StillImage>();
image->width = w;
image->height = h;
- image->pixels = util::make_unique<uint32_t[]>(w * h);
+ image->pixels = std::make_unique<uint32_t[]>(w * h);
MBGL_CHECK_ERROR(glReadPixels(0, 0, w, h, GL_RGBA, GL_UNSIGNED_BYTE, image->pixels.get()));
const int stride = w * 4;
- auto tmp = util::make_unique<char[]>(stride);
+ auto tmp = std::make_unique<char[]>(stride);
char *rgba = reinterpret_cast<char *>(image->pixels.get());
for (int i = 0, j = h - 1; i < j; i++, j--) {
std::memcpy(tmp.get(), rgba + i * stride, stride);
diff --git a/platform/default/http_request_curl.cpp b/platform/default/http_request_curl.cpp
index 45115b621f..8599ea05ee 100644
--- a/platform/default/http_request_curl.cpp
+++ b/platform/default/http_request_curl.cpp
@@ -385,7 +385,7 @@ static CURLcode sslctx_function(CURL * /* curl */, void *sslctx, void * /* parm
return CURLE_SSL_CACERT_BADFILE;
}
- const auto pem = util::make_unique<char[]>(stat.size);
+ const auto pem = std::make_unique<char[]>(stat.size);
if (static_cast<zip_uint64_t>(zip_fread(apkFile, reinterpret_cast<void *>(pem.get()), stat.size)) != stat.size) {
zip_fclose(apkFile);
@@ -537,7 +537,7 @@ size_t HTTPRequest::writeCallback(void *const contents, const size_t size, const
MBGL_VERIFY_THREAD(impl->tid);
if (!impl->response) {
- impl->response = util::make_unique<Response>();
+ impl->response = std::make_unique<Response>();
}
impl->response->data.append((char *)contents, size * nmemb);
@@ -581,7 +581,7 @@ size_t HTTPRequest::headerCallback(char *const buffer, const size_t size, const
MBGL_VERIFY_THREAD(baton->tid);
if (!baton->response) {
- baton->response = util::make_unique<Response>();
+ baton->response = std::make_unique<Response>();
}
const size_t length = size * nmemb;
@@ -675,7 +675,7 @@ void HTTPRequest::handleResult(CURLcode code) {
// Make sure a response object exists in case we haven't got any headers
// or content.
if (!response) {
- response = util::make_unique<Response>();
+ response = std::make_unique<Response>();
}
// Add human-readable error code
@@ -734,7 +734,7 @@ void HTTPRequest::handleResult(CURLcode code) {
}
std::unique_ptr<HTTPContext> HTTPContext::createContext(uv_loop_t* loop) {
- return util::make_unique<HTTPCURLContext>(loop);
+ return std::make_unique<HTTPCURLContext>(loop);
}
}
diff --git a/platform/default/image.cpp b/platform/default/image.cpp
index 1a10d78ffa..12aea898c8 100644
--- a/platform/default/image.cpp
+++ b/platform/default/image.cpp
@@ -1,7 +1,6 @@
#include <mbgl/util/image.hpp>
#include <mbgl/platform/log.hpp>
#include <mbgl/util/string.hpp>
-#include <mbgl/util/std.hpp>
#include <png.h>
@@ -82,7 +81,7 @@ Image::Image(std::string const& data)
auto reader = getImageReader(data.c_str(), data.size());
width = reader->width();
height = reader->height();
- img = util::make_unique<char[]>(width * height * 4);
+ img = std::make_unique<char[]>(width * height * 4);
reader->read(0, 0, width, height, img.get());
}
catch (ImageReaderException const& ex)
diff --git a/platform/default/image_reader.cpp b/platform/default/image_reader.cpp
index fc6daec6a5..e80ccb6819 100644
--- a/platform/default/image_reader.cpp
+++ b/platform/default/image_reader.cpp
@@ -49,11 +49,11 @@ std::unique_ptr<ImageReader> getImageReader(char const* data, size_t size)
{
if (*type == "png")
{
- return util::make_unique<PngReader<boost::iostreams::array_source>>(data, size);
+ return std::make_unique<PngReader<boost::iostreams::array_source>>(data, size);
}
else if (*type == "jpeg")
{
- return util::make_unique<JpegReader<boost::iostreams::array_source>>(data, size);
+ return std::make_unique<JpegReader<boost::iostreams::array_source>>(data, size);
}
}
throw ImageReaderException("ImageReader: can't determine type from input data");
diff --git a/platform/default/sqlite_cache.cpp b/platform/default/sqlite_cache.cpp
index fb4cdf74e7..06d168ce4e 100644
--- a/platform/default/sqlite_cache.cpp
+++ b/platform/default/sqlite_cache.cpp
@@ -62,7 +62,7 @@ std::string unifyMapboxURLs(const std::string &url) {
using namespace mapbox::sqlite;
SQLiteCache::SQLiteCache(const std::string& path_)
- : thread(util::make_unique<util::Thread<Impl>>("SQLite Cache", util::ThreadPriority::Low, path_)) {
+ : thread(std::make_unique<util::Thread<Impl>>("SQLite Cache", util::ThreadPriority::Low, path_)) {
}
SQLiteCache::~SQLiteCache() = default;
@@ -85,7 +85,7 @@ SQLiteCache::Impl::~Impl() {
}
void SQLiteCache::Impl::createDatabase() {
- db = util::make_unique<Database>(path.c_str(), ReadWrite | Create);
+ db = std::make_unique<Database>(path.c_str(), ReadWrite | Create);
}
void SQLiteCache::Impl::createSchema() {
@@ -114,7 +114,7 @@ void SQLiteCache::Impl::createSchema() {
} catch (util::IOException& ioEx) {
Log::Error(Event::Database, ex.code, ex.what());
}
- db = util::make_unique<Database>(path.c_str(), ReadWrite | Create);
+ db = std::make_unique<Database>(path.c_str(), ReadWrite | Create);
} else {
Log::Error(Event::Database, ex.code, ex.what());
}
@@ -146,8 +146,8 @@ std::unique_ptr<Response> SQLiteCache::Impl::get(const Resource &resource) {
}
if (!getStmt) {
- // Initialize the statement 0 1
- getStmt = util::make_unique<Statement>(db->prepare("SELECT `status`, `modified`, "
+ // Initialize the statement 0 1
+ getStmt = std::make_unique<Statement>(db->prepare("SELECT `status`, `modified`, "
// 2 3 4 5 1
"`etag`, `expires`, `data`, `compressed` FROM `http_cache` WHERE `url` = ?"));
} else {
@@ -158,7 +158,7 @@ std::unique_ptr<Response> SQLiteCache::Impl::get(const Resource &resource) {
getStmt->bind(1, unifiedURL.c_str());
if (getStmt->run()) {
// There is data.
- auto response = util::make_unique<Response>();
+ auto response = std::make_unique<Response>();
response->status = Response::Status(getStmt->get<int>(0));
response->modified = getStmt->get<int64_t>(1);
response->etag = getStmt->get<std::string>(2);
@@ -200,7 +200,7 @@ void SQLiteCache::Impl::put(const Resource& resource, std::shared_ptr<const Resp
}
if (!putStmt) {
- putStmt = util::make_unique<Statement>(db->prepare("REPLACE INTO `http_cache` ("
+ putStmt = std::make_unique<Statement>(db->prepare("REPLACE INTO `http_cache` ("
// 1 2 3 4 5 6 7 8
"`url`, `status`, `kind`, `modified`, `etag`, `expires`, `data`, `compressed`"
") VALUES(?, ?, ?, ?, ?, ?, ?, ?)"));
@@ -249,7 +249,7 @@ void SQLiteCache::Impl::refresh(const Resource& resource, int64_t expires) {
}
if (!refreshStmt) {
- refreshStmt = util::make_unique<Statement>( // 1 2
+ refreshStmt = std::make_unique<Statement>( // 1 2
db->prepare("UPDATE `http_cache` SET `expires` = ? WHERE `url` = ?"));
} else {
refreshStmt->reset();
diff --git a/src/mbgl/geometry/glyph_atlas.cpp b/src/mbgl/geometry/glyph_atlas.cpp
index 0c6af54785..067c5a4062 100644
--- a/src/mbgl/geometry/glyph_atlas.cpp
+++ b/src/mbgl/geometry/glyph_atlas.cpp
@@ -6,8 +6,6 @@
#include <mbgl/platform/log.hpp>
#include <mbgl/platform/platform.hpp>
-#include <mbgl/util/std.hpp>
-
#include <cassert>
#include <algorithm>
@@ -18,7 +16,7 @@ GlyphAtlas::GlyphAtlas(uint16_t width_, uint16_t height_)
: width(width_),
height(height_),
bin(width_, height_),
- data(util::make_unique<uint8_t[]>(width_ * height_)),
+ data(std::make_unique<uint8_t[]>(width_ * height_)),
dirty(true) {
}
diff --git a/src/mbgl/geometry/line_atlas.cpp b/src/mbgl/geometry/line_atlas.cpp
index 91ac15639b..dc5ee0901a 100644
--- a/src/mbgl/geometry/line_atlas.cpp
+++ b/src/mbgl/geometry/line_atlas.cpp
@@ -3,7 +3,6 @@
#include <mbgl/platform/gl.hpp>
#include <mbgl/platform/log.hpp>
#include <mbgl/platform/platform.hpp>
-#include <mbgl/util/std.hpp>
#include <boost/functional/hash.hpp>
@@ -15,7 +14,7 @@ using namespace mbgl;
LineAtlas::LineAtlas(uint16_t w, uint16_t h)
: width(w),
height(h),
- data(util::make_unique<uint8_t[]>(w * h)),
+ data(std::make_unique<uint8_t[]>(w * h)),
dirty(true) {
}
diff --git a/src/mbgl/geometry/sprite_atlas.cpp b/src/mbgl/geometry/sprite_atlas.cpp
index 30624e2d1c..93bc76aa5c 100644
--- a/src/mbgl/geometry/sprite_atlas.cpp
+++ b/src/mbgl/geometry/sprite_atlas.cpp
@@ -140,7 +140,7 @@ void SpriteAtlas::allocate() {
if (!data) {
dimension w = static_cast<dimension>(width * pixelRatio);
dimension h = static_cast<dimension>(height * pixelRatio);
- data = util::make_unique<uint32_t[]>(w * h);
+ data = std::make_unique<uint32_t[]>(w * h);
std::fill(data.get(), data.get() + w * h, 0);
}
}
diff --git a/src/mbgl/map/annotation.cpp b/src/mbgl/map/annotation.cpp
index 7a7a0ed683..d30052c94a 100644
--- a/src/mbgl/map/annotation.cpp
+++ b/src/mbgl/map/annotation.cpp
@@ -5,7 +5,6 @@
#include <mbgl/map/map_data.hpp>
#include <mbgl/util/constants.hpp>
#include <mbgl/util/ptr.hpp>
-#include <mbgl/util/std.hpp>
#include <algorithm>
#include <memory>
@@ -110,7 +109,7 @@ AnnotationManager::addPointAnnotations(const std::vector<LatLng>& points,
// track the annotation global ID and its geometry
auto anno_it = annotations.emplace(
annotationID,
- util::make_unique<Annotation>(AnnotationType::Point,
+ std::make_unique<Annotation>(AnnotationType::Point,
AnnotationSegments({ { points[i] } })));
const uint8_t maxZoom = data.transform.getMaxZoom();
@@ -162,7 +161,7 @@ AnnotationManager::addPointAnnotations(const std::vector<LatLng>& points,
// create tile & record annotation association
auto tile_pos = tiles.emplace(
tileID, std::make_pair(std::unordered_set<uint32_t>({ annotationID }),
- util::make_unique<LiveTile>()));
+ std::make_unique<LiveTile>()));
// add point layer to tile
tile_pos.first->second.second->addLayer(layerID, layer);
}
diff --git a/src/mbgl/map/annotation.hpp b/src/mbgl/map/annotation.hpp
index a80b03226f..0c9a078e57 100644
--- a/src/mbgl/map/annotation.hpp
+++ b/src/mbgl/map/annotation.hpp
@@ -4,7 +4,6 @@
#include <mbgl/map/tile_id.hpp>
#include <mbgl/util/geo.hpp>
#include <mbgl/util/noncopyable.hpp>
-#include <mbgl/util/std.hpp>
#include <mbgl/util/vec.hpp>
#include <string>
diff --git a/src/mbgl/map/map.cpp b/src/mbgl/map/map.cpp
index 1141cf83bd..026297fb46 100644
--- a/src/mbgl/map/map.cpp
+++ b/src/mbgl/map/map.cpp
@@ -3,15 +3,14 @@
#include <mbgl/map/view.hpp>
#include <mbgl/map/map_data.hpp>
-#include <mbgl/util/std.hpp>
#include <mbgl/util/projection.hpp>
#include <mbgl/util/thread.hpp>
namespace mbgl {
Map::Map(View& view, FileSource& fileSource, MapMode mode)
- : data(util::make_unique<MapData>(view, mode)),
- context(util::make_unique<util::Thread<MapContext>>("Map", util::ThreadPriority::Regular, view, fileSource, *data))
+ : data(std::make_unique<MapData>(view, mode)),
+ context(std::make_unique<util::Thread<MapContext>>("Map", util::ThreadPriority::Regular, view, fileSource, *data))
{
view.initialize(this);
}
diff --git a/src/mbgl/map/map_context.cpp b/src/mbgl/map/map_context.cpp
index 2a03adb158..c8948097f7 100644
--- a/src/mbgl/map/map_context.cpp
+++ b/src/mbgl/map/map_context.cpp
@@ -20,7 +20,6 @@
#include <mbgl/style/style.hpp>
-#include <mbgl/util/std.hpp>
#include <mbgl/util/uv_detail.hpp>
#include <mbgl/util/worker.hpp>
#include <mbgl/util/texture_pool.hpp>
@@ -34,12 +33,12 @@ MapContext::MapContext(uv_loop_t* loop, View& view_, FileSource& fileSource, Map
env(fileSource),
envScope(env, ThreadType::Map, "Map"),
updated(static_cast<UpdateType>(Update::Nothing)),
- asyncUpdate(util::make_unique<uv::async>(loop, [this] { update(); })),
- glyphStore(util::make_unique<GlyphStore>(loop, env)),
- glyphAtlas(util::make_unique<GlyphAtlas>(1024, 1024)),
- spriteAtlas(util::make_unique<SpriteAtlas>(512, 512)),
- lineAtlas(util::make_unique<LineAtlas>(512, 512)),
- texturePool(util::make_unique<TexturePool>()) {
+ asyncUpdate(std::make_unique<uv::async>(loop, [this] { update(); })),
+ glyphStore(std::make_unique<GlyphStore>(loop, env)),
+ glyphAtlas(std::make_unique<GlyphAtlas>(1024, 1024)),
+ spriteAtlas(std::make_unique<SpriteAtlas>(512, 512)),
+ lineAtlas(std::make_unique<LineAtlas>(512, 512)),
+ texturePool(std::make_unique<TexturePool>()) {
assert(Environment::currentlyOn(ThreadType::Map));
asyncUpdate->unref();
@@ -120,7 +119,7 @@ void MapContext::loadStyleJSON(const std::string& json, const std::string& base)
resourceLoader.reset();
style.reset();
- style = util::make_unique<Style>();
+ style = std::make_unique<Style>();
style->base = base;
style->loadJSON((const uint8_t *)json.c_str());
style->cascade(data.getClasses());
@@ -128,7 +127,7 @@ void MapContext::loadStyleJSON(const std::string& json, const std::string& base)
glyphStore->setURL(style->glyph_url);
- resourceLoader = util::make_unique<ResourceLoader>();
+ resourceLoader = std::make_unique<ResourceLoader>();
resourceLoader->setObserver(this);
resourceLoader->setStyle(style.get());
resourceLoader->setGlyphStore(glyphStore.get());
@@ -221,7 +220,7 @@ void MapContext::render() {
assert(style);
if (!painter) {
- painter = util::make_unique<Painter>(*spriteAtlas, *glyphAtlas, *lineAtlas);
+ painter = std::make_unique<Painter>(*spriteAtlas, *glyphAtlas, *lineAtlas);
painter->setup();
}
diff --git a/src/mbgl/map/resource_loader.cpp b/src/mbgl/map/resource_loader.cpp
index 49c169d201..8e054c0d82 100644
--- a/src/mbgl/map/resource_loader.cpp
+++ b/src/mbgl/map/resource_loader.cpp
@@ -71,7 +71,7 @@ void ResourceLoader::update(MapData& data,
const float pixelRatio = transform.getPixelRatio();
if (!sprite_ || !sprite_->hasPixelRatio(pixelRatio)) {
- sprite_ = util::make_unique<Sprite>(style_->getSpriteURL(), pixelRatio);
+ sprite_ = std::make_unique<Sprite>(style_->getSpriteURL(), pixelRatio);
sprite_->setObserver(this);
spriteAtlas.resize(pixelRatio);
diff --git a/src/mbgl/map/source.cpp b/src/mbgl/map/source.cpp
index b35bdac33c..eb273d785d 100644
--- a/src/mbgl/map/source.cpp
+++ b/src/mbgl/map/source.cpp
@@ -14,6 +14,7 @@
#include <mbgl/style/style_layer.hpp>
#include <mbgl/platform/log.hpp>
#include <mbgl/util/uv_detail.hpp>
+#include <mbgl/util/std.hpp>
#include <mbgl/util/token.hpp>
#include <mbgl/util/string.hpp>
#include <mbgl/util/tile_cover.hpp>
@@ -264,7 +265,7 @@ TileData::State Source::addTile(MapData& data,
return state;
}
- auto pos = tiles.emplace(id, util::make_unique<Tile>(id));
+ auto pos = tiles.emplace(id, std::make_unique<Tile>(id));
Tile& new_tile = *pos.first->second;
// We couldn't find the tile in the list. Create a new one.
diff --git a/src/mbgl/map/sprite.cpp b/src/mbgl/map/sprite.cpp
index d8cadbeb3f..fd3615f912 100644
--- a/src/mbgl/map/sprite.cpp
+++ b/src/mbgl/map/sprite.cpp
@@ -7,7 +7,6 @@
#include <mbgl/storage/response.hpp>
#include <mbgl/util/exception.hpp>
#include <mbgl/util/raster.hpp>
-#include <mbgl/util/std.hpp>
#include <mbgl/util/uv_detail.hpp>
#include <rapidjson/document.h>
@@ -107,7 +106,7 @@ bool Sprite::hasPixelRatio(float ratio) const {
}
void Sprite::parseImage() {
- raster = util::make_unique<util::Image>(image);
+ raster = std::make_unique<util::Image>(image);
if (!*raster) {
raster.reset();
}
diff --git a/src/mbgl/map/tile_parser.cpp b/src/mbgl/map/tile_parser.cpp
index a932453136..9c0b5e26e1 100644
--- a/src/mbgl/map/tile_parser.cpp
+++ b/src/mbgl/map/tile_parser.cpp
@@ -8,7 +8,6 @@
#include <mbgl/renderer/line_bucket.hpp>
#include <mbgl/renderer/symbol_bucket.hpp>
#include <mbgl/util/constants.hpp>
-#include <mbgl/util/std.hpp>
#include <mbgl/style/style.hpp>
#include <locale>
@@ -154,7 +153,7 @@ void TileParser::addBucketGeometries(Bucket& bucket, const GeometryTileLayer& la
std::unique_ptr<Bucket> TileParser::createFillBucket(const GeometryTileLayer& layer,
const StyleBucket& bucket_desc) {
- auto bucket = util::make_unique<FillBucket>(tile.fillVertexBuffer,
+ auto bucket = std::make_unique<FillBucket>(tile.fillVertexBuffer,
tile.triangleElementsBuffer,
tile.lineElementsBuffer);
addBucketGeometries(bucket, layer, bucket_desc.filter);
@@ -163,7 +162,7 @@ std::unique_ptr<Bucket> TileParser::createFillBucket(const GeometryTileLayer& la
std::unique_ptr<Bucket> TileParser::createLineBucket(const GeometryTileLayer& layer,
const StyleBucket& bucket_desc) {
- auto bucket = util::make_unique<LineBucket>(tile.lineVertexBuffer,
+ auto bucket = std::make_unique<LineBucket>(tile.lineVertexBuffer,
tile.triangleElementsBuffer);
const float z = tile.id.z;
@@ -180,7 +179,7 @@ std::unique_ptr<Bucket> TileParser::createLineBucket(const GeometryTileLayer& la
std::unique_ptr<Bucket> TileParser::createSymbolBucket(const GeometryTileLayer& layer,
const StyleBucket& bucket_desc) {
- auto bucket = util::make_unique<SymbolBucket>(*tile.getCollision());
+ auto bucket = std::make_unique<SymbolBucket>(*tile.getCollision());
const float z = tile.id.z;
auto& layout = bucket->layout;
diff --git a/src/mbgl/map/transform.cpp b/src/mbgl/map/transform.cpp
index f5e9f00998..182e534295 100644
--- a/src/mbgl/map/transform.cpp
+++ b/src/mbgl/map/transform.cpp
@@ -2,7 +2,6 @@
#include <mbgl/map/view.hpp>
#include <mbgl/util/constants.hpp>
#include <mbgl/util/mat4.hpp>
-#include <mbgl/util/std.hpp>
#include <mbgl/util/math.hpp>
#include <mbgl/util/unitbezier.hpp>
#include <mbgl/util/interpolate.hpp>
diff --git a/src/mbgl/map/vector_tile_data.cpp b/src/mbgl/map/vector_tile_data.cpp
index 801d9a7c57..4d77c8ef81 100644
--- a/src/mbgl/map/vector_tile_data.cpp
+++ b/src/mbgl/map/vector_tile_data.cpp
@@ -1,6 +1,5 @@
#include <mbgl/map/vector_tile_data.hpp>
#include <mbgl/map/tile_parser.hpp>
-#include <mbgl/util/std.hpp>
#include <mbgl/style/style_layer.hpp>
#include <mbgl/style/style_bucket.hpp>
#include <mbgl/map/source.hpp>
@@ -26,7 +25,7 @@ VectorTileData::VectorTileData(const TileID& id_,
spriteAtlas(spriteAtlas_),
sprite(sprite_),
style(style_),
- collision(util::make_unique<Collision>(id_.z, 4096, source_.tile_size, depth)) {
+ collision(std::make_unique<Collision>(id_.z, 4096, source_.tile_size, depth)) {
}
VectorTileData::~VectorTileData() {
diff --git a/src/mbgl/renderer/fill_bucket.cpp b/src/mbgl/renderer/fill_bucket.cpp
index c59b0970e0..a98a8b7cdf 100644
--- a/src/mbgl/renderer/fill_bucket.cpp
+++ b/src/mbgl/renderer/fill_bucket.cpp
@@ -7,7 +7,6 @@
#include <mbgl/shader/plain_shader.hpp>
#include <mbgl/shader/pattern_shader.hpp>
#include <mbgl/shader/outline_shader.hpp>
-#include <mbgl/util/std.hpp>
#include <mbgl/platform/gl.hpp>
#include <mbgl/platform/log.hpp>
@@ -107,7 +106,7 @@ void FillBucket::tessellate() {
if (!lineGroups.size() || (lineGroups.back()->vertex_length + total_vertex_count > 65535)) {
// Move to a new group because the old one can't hold the geometry.
- lineGroups.emplace_back(util::make_unique<LineGroup>());
+ lineGroups.emplace_back(std::make_unique<LineGroup>());
}
assert(lineGroups.back());
@@ -154,7 +153,7 @@ void FillBucket::tessellate() {
if (!triangleGroups.size() || (triangleGroups.back()->vertex_length + total_vertex_count > 65535)) {
// Move to a new group because the old one can't hold the geometry.
- triangleGroups.emplace_back(util::make_unique<TriangleGroup>());
+ triangleGroups.emplace_back(std::make_unique<TriangleGroup>());
}
// We're generating triangle fans, so we always start with the first
diff --git a/src/mbgl/renderer/line_bucket.cpp b/src/mbgl/renderer/line_bucket.cpp
index bbfc02ead1..f696874afe 100644
--- a/src/mbgl/renderer/line_bucket.cpp
+++ b/src/mbgl/renderer/line_bucket.cpp
@@ -8,7 +8,6 @@
#include <mbgl/shader/linesdf_shader.hpp>
#include <mbgl/shader/linepattern_shader.hpp>
#include <mbgl/util/math.hpp>
-#include <mbgl/util/std.hpp>
#include <mbgl/platform/gl.hpp>
#ifndef BUFFER_OFFSET
@@ -290,7 +289,7 @@ void LineBucket::addGeometry(const std::vector<Coordinate>& vertices) {
if (!triangleGroups.size() ||
(triangleGroups.back()->vertex_length + vertexCount > 65535)) {
// Move to a new group because the old one can't hold the geometry.
- triangleGroups.emplace_back(util::make_unique<TriangleGroup>());
+ triangleGroups.emplace_back(std::make_unique<TriangleGroup>());
}
assert(triangleGroups.back());
diff --git a/src/mbgl/renderer/painter.cpp b/src/mbgl/renderer/painter.cpp
index bcbb75e69a..a8e420215f 100644
--- a/src/mbgl/renderer/painter.cpp
+++ b/src/mbgl/renderer/painter.cpp
@@ -26,7 +26,6 @@
#include <mbgl/shader/dot_shader.hpp>
#include <mbgl/shader/gaussian_shader.hpp>
-#include <mbgl/util/std.hpp>
#include <mbgl/util/constants.hpp>
#include <mbgl/util/mat3.hpp>
@@ -94,18 +93,18 @@ void Painter::setup() {
}
void Painter::setupShaders() {
- if (!plainShader) plainShader = util::make_unique<PlainShader>();
- if (!outlineShader) outlineShader = util::make_unique<OutlineShader>();
- if (!lineShader) lineShader = util::make_unique<LineShader>();
- if (!linesdfShader) linesdfShader = util::make_unique<LineSDFShader>();
- if (!linepatternShader) linepatternShader = util::make_unique<LinepatternShader>();
- if (!patternShader) patternShader = util::make_unique<PatternShader>();
- if (!iconShader) iconShader = util::make_unique<IconShader>();
- if (!rasterShader) rasterShader = util::make_unique<RasterShader>();
- if (!sdfGlyphShader) sdfGlyphShader = util::make_unique<SDFGlyphShader>();
- if (!sdfIconShader) sdfIconShader = util::make_unique<SDFIconShader>();
- if (!dotShader) dotShader = util::make_unique<DotShader>();
- if (!gaussianShader) gaussianShader = util::make_unique<GaussianShader>();
+ if (!plainShader) plainShader = std::make_unique<PlainShader>();
+ if (!outlineShader) outlineShader = std::make_unique<OutlineShader>();
+ if (!lineShader) lineShader = std::make_unique<LineShader>();
+ if (!linesdfShader) linesdfShader = std::make_unique<LineSDFShader>();
+ if (!linepatternShader) linepatternShader = std::make_unique<LinepatternShader>();
+ if (!patternShader) patternShader = std::make_unique<PatternShader>();
+ if (!iconShader) iconShader = std::make_unique<IconShader>();
+ if (!rasterShader) rasterShader = std::make_unique<RasterShader>();
+ if (!sdfGlyphShader) sdfGlyphShader = std::make_unique<SDFGlyphShader>();
+ if (!sdfIconShader) sdfIconShader = std::make_unique<SDFIconShader>();
+ if (!dotShader) dotShader = std::make_unique<DotShader>();
+ if (!gaussianShader) gaussianShader = std::make_unique<GaussianShader>();
}
void Painter::resize() {
diff --git a/src/mbgl/renderer/painter_fill.cpp b/src/mbgl/renderer/painter_fill.cpp
index 6f6783f0e2..64dc3d2f0a 100644
--- a/src/mbgl/renderer/painter_fill.cpp
+++ b/src/mbgl/renderer/painter_fill.cpp
@@ -9,7 +9,6 @@
#include <mbgl/shader/outline_shader.hpp>
#include <mbgl/shader/pattern_shader.hpp>
#include <mbgl/shader/plain_shader.hpp>
-#include <mbgl/util/std.hpp>
#include <mbgl/util/mat3.hpp>
using namespace mbgl;
diff --git a/src/mbgl/renderer/painter_raster.cpp b/src/mbgl/renderer/painter_raster.cpp
index 61aff9c1a8..2a8f8e7078 100644
--- a/src/mbgl/renderer/painter_raster.cpp
+++ b/src/mbgl/renderer/painter_raster.cpp
@@ -3,7 +3,6 @@
#include <mbgl/renderer/raster_bucket.hpp>
#include <mbgl/style/style_layer.hpp>
#include <mbgl/shader/raster_shader.hpp>
-#include <mbgl/util/std.hpp>
using namespace mbgl;
diff --git a/src/mbgl/renderer/symbol_bucket.cpp b/src/mbgl/renderer/symbol_bucket.cpp
index 28113b6184..02e7e0cc6a 100644
--- a/src/mbgl/renderer/symbol_bucket.cpp
+++ b/src/mbgl/renderer/symbol_bucket.cpp
@@ -21,7 +21,6 @@
#include <mbgl/util/token.hpp>
#include <mbgl/util/math.hpp>
#include <mbgl/util/merge_lines.hpp>
-#include <mbgl/util/std.hpp>
#ifndef BUFFER_OFFSET
#define BUFFER_OFFSET(i) ((char *)nullptr + (i))
@@ -409,7 +408,7 @@ void SymbolBucket::addSymbols(Buffer &buffer, const PlacedGlyphs &symbols, float
if (!buffer.groups.size() ||
(buffer.groups.back()->vertex_length + glyph_vertex_length > 65535)) {
// Move to a new group because the old one can't hold the geometry.
- buffer.groups.emplace_back(util::make_unique<GroupType>());
+ buffer.groups.emplace_back(std::make_unique<GroupType>());
}
// We're generating triangle fans, so we always start with the first
diff --git a/src/mbgl/shader/shader.cpp b/src/mbgl/shader/shader.cpp
index a079409aa0..6210c1c32e 100644
--- a/src/mbgl/shader/shader.cpp
+++ b/src/mbgl/shader/shader.cpp
@@ -51,7 +51,7 @@ Shader::Shader(const char *name_, const GLchar *vertSource, const GLchar *fragSo
if (status == 0) {
GLint logLength;
MBGL_CHECK_ERROR(glGetProgramiv(program, GL_INFO_LOG_LENGTH, &logLength));
- std::unique_ptr<GLchar[]> log = mbgl::util::make_unique<GLchar[]>(logLength);
+ const auto log = std::make_unique<GLchar[]>(logLength);
if (logLength > 0) {
MBGL_CHECK_ERROR(glGetProgramInfoLog(program, logLength, &logLength, log.get()));
Log::Error(Event::Shader, "Program failed to link: %s", log.get());
@@ -76,7 +76,7 @@ Shader::Shader(const char *name_, const GLchar *vertSource, const GLchar *fragSo
if (status == 0) {
GLint logLength;
MBGL_CHECK_ERROR(glGetProgramiv(program, GL_INFO_LOG_LENGTH, &logLength));
- std::unique_ptr<GLchar[]> log = mbgl::util::make_unique<GLchar[]>(logLength);
+ const auto log = std::make_unique<GLchar[]>(logLength);
if (logLength > 0) {
MBGL_CHECK_ERROR(glGetProgramInfoLog(program, logLength, &logLength, log.get()));
Log::Error(Event::Shader, "Program failed to validate: %s", log.get());
@@ -115,7 +115,7 @@ bool Shader::compileShader(GLuint *shader, GLenum type, const GLchar *source) {
GLint logLength;
MBGL_CHECK_ERROR(glGetShaderiv(*shader, GL_INFO_LOG_LENGTH, &logLength));
if (logLength > 0) {
- std::unique_ptr<GLchar[]> log = mbgl::util::make_unique<GLchar[]>(logLength);
+ const auto log = std::make_unique<GLchar[]>(logLength);
MBGL_CHECK_ERROR(glGetShaderInfoLog(*shader, logLength, &logLength, log.get()));
Log::Error(Event::Shader, "Shader failed to compile: %s", log.get());
}
diff --git a/src/mbgl/storage/default_file_source.cpp b/src/mbgl/storage/default_file_source.cpp
index 78a1132f17..b46696aaa3 100644
--- a/src/mbgl/storage/default_file_source.cpp
+++ b/src/mbgl/storage/default_file_source.cpp
@@ -28,7 +28,7 @@ namespace algo = boost::algorithm;
namespace mbgl {
DefaultFileSource::DefaultFileSource(FileCache* cache, const std::string& root)
- : thread(util::make_unique<util::Thread<Impl>>("FileSource", util::ThreadPriority::Low, cache, root)) {
+ : thread(std::make_unique<util::Thread<Impl>>("FileSource", util::ThreadPriority::Low, cache, root)) {
}
DefaultFileSource::~DefaultFileSource() {
diff --git a/src/mbgl/storage/request.cpp b/src/mbgl/storage/request.cpp
index a6d845ce4a..b653a41e71 100644
--- a/src/mbgl/storage/request.cpp
+++ b/src/mbgl/storage/request.cpp
@@ -4,7 +4,6 @@
#include <mbgl/storage/response.hpp>
#include <mbgl/util/util.hpp>
-#include <mbgl/util/std.hpp>
#include <mbgl/util/uv_detail.hpp>
#include <cassert>
@@ -16,7 +15,7 @@ struct Request::Canceled { std::mutex mutex; bool confirmed = false; };
// Note: This requires that loop is running in the current thread (or not yet running).
Request::Request(const Resource &resource_, uv_loop_t *loop, Callback callback_)
- : async(util::make_unique<uv::async>(loop, [this] { notifyCallback(); })),
+ : async(std::make_unique<uv::async>(loop, [this] { notifyCallback(); })),
callback(callback_),
resource(resource_) {
}
@@ -62,7 +61,7 @@ void Request::notify(const std::shared_ptr<const Response> &response_) {
void Request::cancel() {
assert(async);
assert(!canceled);
- canceled = util::make_unique<Canceled>();
+ canceled = std::make_unique<Canceled>();
}
diff --git a/src/mbgl/style/style.cpp b/src/mbgl/style/style.cpp
index 51d92fdcaf..0acf66eb56 100644
--- a/src/mbgl/style/style.cpp
+++ b/src/mbgl/style/style.cpp
@@ -5,7 +5,6 @@
#include <mbgl/style/style_parser.hpp>
#include <mbgl/style/style_bucket.hpp>
#include <mbgl/util/constants.hpp>
-#include <mbgl/util/std.hpp>
#include <mbgl/util/uv_detail.hpp>
#include <mbgl/platform/log.hpp>
#include <csscolorparser/csscolorparser.hpp>
@@ -17,7 +16,7 @@
namespace mbgl {
Style::Style()
- : mtx(util::make_unique<uv::rwlock>()),
+ : mtx(std::make_unique<uv::rwlock>()),
workers(4) {
}
diff --git a/src/mbgl/style/style_parser.cpp b/src/mbgl/style/style_parser.cpp
index 313fe3df89..83a113f885 100644
--- a/src/mbgl/style/style_parser.cpp
+++ b/src/mbgl/style/style_parser.cpp
@@ -3,7 +3,6 @@
#include <mbgl/style/style_layer.hpp>
#include <mbgl/map/annotation.hpp>
#include <mbgl/util/constants.hpp>
-#include <mbgl/util/std.hpp>
#include <mbgl/util/vec.hpp>
#include <mbgl/util/uv_detail.hpp>
#include <mbgl/platform/log.hpp>
diff --git a/src/mbgl/text/glyph_store.cpp b/src/mbgl/text/glyph_store.cpp
index c6e00f0591..ea451e278d 100644
--- a/src/mbgl/text/glyph_store.cpp
+++ b/src/mbgl/text/glyph_store.cpp
@@ -3,15 +3,14 @@
#include <mbgl/text/font_stack.hpp>
#include <mbgl/util/exception.hpp>
-#include <mbgl/util/std.hpp>
#include <mbgl/util/uv_detail.hpp>
namespace mbgl {
GlyphStore::GlyphStore(uv_loop_t* loop, Environment& env_)
: env(env_),
- asyncEmitGlyphRangeLoaded(util::make_unique<uv::async>(loop, [this] { emitGlyphRangeLoaded(); })),
- asyncEmitGlyphRangeLoadedingFailed(util::make_unique<uv::async>(loop, [this] { emitGlyphRangeLoadingFailed(); })),
+ asyncEmitGlyphRangeLoaded(std::make_unique<uv::async>(loop, [this] { emitGlyphRangeLoaded(); })),
+ asyncEmitGlyphRangeLoadedingFailed(std::make_unique<uv::async>(loop, [this] { emitGlyphRangeLoadingFailed(); })),
observer(nullptr) {
asyncEmitGlyphRangeLoaded->unref();
asyncEmitGlyphRangeLoadedingFailed->unref();
@@ -51,7 +50,7 @@ bool GlyphStore::requestGlyphRangesIfNeeded(const std::string& fontStackName,
for (const auto& range : glyphRanges) {
const auto& rangeSets_it = rangeSets.find(range);
if (rangeSets_it == rangeSets.end()) {
- auto glyph = util::make_unique<GlyphPBF>(glyphURL, fontStackName, range, env,
+ auto glyph = std::make_unique<GlyphPBF>(glyphURL, fontStackName, range, env,
successCallback, failureCallback);
rangeSets.emplace(range, std::move(glyph));
requestIsNeeded = true;
@@ -67,18 +66,18 @@ bool GlyphStore::requestGlyphRangesIfNeeded(const std::string& fontStackName,
}
util::exclusive<FontStack> GlyphStore::createFontStack(const std::string &fontStack) {
- auto lock = util::make_unique<std::lock_guard<std::mutex>>(stacksMutex);
+ auto lock = std::make_unique<std::lock_guard<std::mutex>>(stacksMutex);
auto stack_it = stacks.find(fontStack);
if (stack_it == stacks.end()) {
- stack_it = stacks.emplace(fontStack, util::make_unique<FontStack>()).first;
+ stack_it = stacks.emplace(fontStack, std::make_unique<FontStack>()).first;
}
return { stack_it->second.get(), std::move(lock) };
}
util::exclusive<FontStack> GlyphStore::getFontStack(const std::string &fontStack) {
- auto lock = util::make_unique<std::lock_guard<std::mutex>>(stacksMutex);
+ auto lock = std::make_unique<std::lock_guard<std::mutex>>(stacksMutex);
const auto& stack_it = stacks.find(fontStack);
if (stack_it == stacks.end()) {
diff --git a/src/mbgl/util/raster.cpp b/src/mbgl/util/raster.cpp
index f2171a6165..b6b5df27f6 100644
--- a/src/mbgl/util/raster.cpp
+++ b/src/mbgl/util/raster.cpp
@@ -4,7 +4,6 @@
#include <mbgl/util/raster.hpp>
#include <mbgl/util/uv_detail.hpp>
-#include <mbgl/util/std.hpp>
#include <cassert>
#include <cstring>
@@ -27,7 +26,7 @@ bool Raster::isLoaded() const {
}
bool Raster::load(const std::string &data) {
- img = util::make_unique<util::Image>(data);
+ img = std::make_unique<util::Image>(data);
width = img->getWidth();
height = img->getHeight();
diff --git a/src/mbgl/util/run_loop.hpp b/src/mbgl/util/run_loop.hpp
index 068215a04e..1c92847b69 100644
--- a/src/mbgl/util/run_loop.hpp
+++ b/src/mbgl/util/run_loop.hpp
@@ -2,7 +2,6 @@
#define MBGL_UTIL_RUN_LOOP
#include <mbgl/util/noncopyable.hpp>
-#include <mbgl/util/std.hpp>
#include <mbgl/util/uv_detail.hpp>
#include <functional>
@@ -24,7 +23,7 @@ public:
template <class Fn, class... Args>
void invoke(Fn&& fn, Args&&... args) {
auto tuple = std::make_tuple(std::move(args)...);
- auto invokable = util::make_unique<Invoker<Fn, decltype(tuple), Args...>>(std::move(fn), std::move(tuple));
+ auto invokable = std::make_unique<Invoker<Fn, decltype(tuple), Args...>>(std::move(fn), std::move(tuple));
withMutex([&] { queue.push(std::move(invokable)); });
async.send();
}
diff --git a/src/mbgl/util/worker.cpp b/src/mbgl/util/worker.cpp
index 984c55c95e..3022d30277 100644
--- a/src/mbgl/util/worker.cpp
+++ b/src/mbgl/util/worker.cpp
@@ -19,7 +19,7 @@ public:
Worker::Worker(std::size_t count) {
for (std::size_t i = 0; i < count; i++) {
- threads.emplace_back(util::make_unique<util::Thread<Impl>>("Worker", util::ThreadPriority::Low));
+ threads.emplace_back(std::make_unique<util::Thread<Impl>>("Worker", util::ThreadPriority::Low));
}
}
@@ -27,7 +27,7 @@ Worker::~Worker() = default;
std::unique_ptr<WorkRequest> Worker::send(Fn work, Fn after) {
auto task = std::make_shared<WorkTask>(work, after);
- auto request = util::make_unique<WorkRequest>(task);
+ auto request = std::make_unique<WorkRequest>(task);
threads[current]->invokeWithResult(&Worker::Impl::doWork, [task] {
task->runAfter();
diff --git a/test/api/repeated_render.cpp b/test/api/repeated_render.cpp
index f563b00071..7f55237744 100644
--- a/test/api/repeated_render.cpp
+++ b/test/api/repeated_render.cpp
@@ -20,7 +20,7 @@ TEST(API, RepeatedRender) {
HeadlessView view(display);
DefaultFileSource fileSource(nullptr);
- Log::setObserver(util::make_unique<FixtureLogObserver>());
+ Log::setObserver(std::make_unique<FixtureLogObserver>());
Map map(view, fileSource, MapMode::Still);
diff --git a/test/api/set_style.cpp b/test/api/set_style.cpp
index 01ce1f0252..72260e6343 100644
--- a/test/api/set_style.cpp
+++ b/test/api/set_style.cpp
@@ -14,7 +14,7 @@ TEST(API, SetStyle) {
HeadlessView view(display);
DefaultFileSource fileSource(nullptr);
- Log::setObserver(util::make_unique<FixtureLogObserver>());
+ Log::setObserver(std::make_unique<FixtureLogObserver>());
{
Map map(view, fileSource, MapMode::Still);
diff --git a/test/headless/headless.cpp b/test/headless/headless.cpp
index 8dfed0383b..c65e9855e7 100644
--- a/test/headless/headless.cpp
+++ b/test/headless/headless.cpp
@@ -4,7 +4,6 @@
#include <mbgl/map/map.hpp>
#include <mbgl/map/still_image.hpp>
#include <mbgl/util/image.hpp>
-#include <mbgl/util/std.hpp>
#include <mbgl/util/io.hpp>
#include <rapidjson/document.h>
diff --git a/test/miscellaneous/bilinear.cpp b/test/miscellaneous/bilinear.cpp
index 9808e20fef..bdfb9d9117 100644
--- a/test/miscellaneous/bilinear.cpp
+++ b/test/miscellaneous/bilinear.cpp
@@ -3,7 +3,6 @@
#include <mbgl/util/scaling.hpp>
#include <mbgl/util/image.hpp>
#include <mbgl/util/io.hpp>
-#include <mbgl/util/std.hpp>
#include <algorithm>
#include <cstring>
@@ -24,7 +23,7 @@ TEST(Bilinear, Scaling) {
const uint32_t *srcData = reinterpret_cast<const uint32_t *>(src + 8);
const vec2<uint32_t> srcSize { width, height };
const vec2<uint32_t> dstSize { 128, 128 };
- auto dst = util::make_unique<uint32_t[]>(dstSize.x * dstSize.y);
+ auto dst = std::make_unique<uint32_t[]>(dstSize.x * dstSize.y);
uint32_t *dstData = dst.get();
std::fill(dstData, dstData + dstSize.x * dstSize.y, 0xFFFF00FF);
diff --git a/test/miscellaneous/clip_ids.cpp b/test/miscellaneous/clip_ids.cpp
index e176810862..dd16173a3f 100644
--- a/test/miscellaneous/clip_ids.cpp
+++ b/test/miscellaneous/clip_ids.cpp
@@ -5,7 +5,6 @@
#include <mbgl/util/clip_id.hpp>
#include <mbgl/map/tile.hpp>
-#include <mbgl/util/std.hpp>
using namespace mbgl;
diff --git a/test/resources/mock_file_source.cpp b/test/resources/mock_file_source.cpp
index b6ff99c743..0a9d448d45 100644
--- a/test/resources/mock_file_source.cpp
+++ b/test/resources/mock_file_source.cpp
@@ -31,7 +31,7 @@ void MockFileSource::Impl::handleRequest(Request* req) const {
}
MockFileSource::MockFileSource(const std::string& matchFail)
- : thread_(util::make_unique<util::Thread<Impl>>("FileSource", util::ThreadPriority::Low, matchFail)) {
+ : thread_(std::make_unique<util::Thread<Impl>>("FileSource", util::ThreadPriority::Low, matchFail)) {
}
Request* MockFileSource::request(const Resource& resource, uv_loop_t* loop, Callback callback) {
diff --git a/test/resources/mock_file_source.hpp b/test/resources/mock_file_source.hpp
index 8c76bd5396..55ecd95c13 100644
--- a/test/resources/mock_file_source.hpp
+++ b/test/resources/mock_file_source.hpp
@@ -4,6 +4,7 @@
#include <mbgl/storage/file_source.hpp>
#include <string>
+#include <memory>
namespace mbgl {
diff --git a/test/resources/resource_loader.cpp b/test/resources/resource_loader.cpp
index 4d8dcc63a0..83807156ed 100644
--- a/test/resources/resource_loader.cpp
+++ b/test/resources/resource_loader.cpp
@@ -30,13 +30,13 @@ public:
: env_(fileSource),
envScope_(env_, ThreadType::Map, "Map"),
data_(view, MapMode::Still),
- glyphStore_(util::make_unique<GlyphStore>(loop, env_)),
- glyphAtlas_(util::make_unique<GlyphAtlas>(1024, 1024)),
- spriteAtlas_(util::make_unique<SpriteAtlas>(512, 512)),
- texturePool_(util::make_unique<TexturePool>()),
- style_(util::make_unique<Style>()),
- resourceLoader_(util::make_unique<ResourceLoader>()),
- asyncUpdate(util::make_unique<uv::async>(loop, [this] { update(); })),
+ glyphStore_(std::make_unique<GlyphStore>(loop, env_)),
+ glyphAtlas_(std::make_unique<GlyphAtlas>(1024, 1024)),
+ spriteAtlas_(std::make_unique<SpriteAtlas>(512, 512)),
+ texturePool_(std::make_unique<TexturePool>()),
+ style_(std::make_unique<Style>()),
+ resourceLoader_(std::make_unique<ResourceLoader>()),
+ asyncUpdate(std::make_unique<uv::async>(loop, [this] { update(); })),
callback_(callback) {
asyncUpdate->unref();
@@ -147,7 +147,7 @@ TEST_P(ResourceLoaderTest, RequestFailure) {
};
std::unique_ptr<util::Thread<MockMapContext>> context(
- util::make_unique<util::Thread<MockMapContext>>(
+ std::make_unique<util::Thread<MockMapContext>>(
"Map", util::ThreadPriority::Regular, view, fileSource, callback));
uv_run(loop.get(), UV_RUN_DEFAULT);
diff --git a/test/storage/database.cpp b/test/storage/database.cpp
index a44c7ff4b4..b54b69a133 100644
--- a/test/storage/database.cpp
+++ b/test/storage/database.cpp
@@ -11,7 +11,7 @@
TEST_F(Storage, DatabaseDoesNotExist) {
using namespace mbgl;
- Log::setObserver(util::make_unique<FixtureLogObserver>());
+ Log::setObserver(std::make_unique<FixtureLogObserver>());
SQLiteCache::Impl cache(nullptr, "test/fixtures/404/cache.db");
@@ -52,7 +52,7 @@ TEST_F(Storage, DatabaseCreate) {
createDir("test/fixtures/database");
deleteFile("test/fixtures/database/cache.db");
- Log::setObserver(util::make_unique<FixtureLogObserver>());
+ Log::setObserver(std::make_unique<FixtureLogObserver>());
SQLiteCache::Impl cache(nullptr, "test/fixtures/database/cache.db");
@@ -113,7 +113,7 @@ TEST_F(Storage, DatabaseLockedRead) {
{
// First request should fail.
- Log::setObserver(util::make_unique<FixtureLogObserver>());
+ Log::setObserver(std::make_unique<FixtureLogObserver>());
std::unique_ptr<Response> res = cache.get({ Resource::Unknown, "mapbox://test" });
EXPECT_EQ(nullptr, res.get());
@@ -129,7 +129,7 @@ TEST_F(Storage, DatabaseLockedRead) {
{
// First, try getting a file (the cache value should not exist).
- Log::setObserver(util::make_unique<FixtureLogObserver>());
+ Log::setObserver(std::make_unique<FixtureLogObserver>());
std::unique_ptr<Response> res = cache.get({ Resource::Unknown, "mapbox://test" });
EXPECT_EQ(nullptr, res.get());
@@ -153,7 +153,7 @@ TEST_F(Storage, DatabaseLockedWrite) {
{
// Adds a file (which should fail).
- Log::setObserver(util::make_unique<FixtureLogObserver>());
+ Log::setObserver(std::make_unique<FixtureLogObserver>());
auto response = std::make_shared<Response>();
cache.put({ Resource::Unknown, "mapbox://test" }, response);
@@ -170,7 +170,7 @@ TEST_F(Storage, DatabaseLockedWrite) {
{
// Then, set a file and obtain it again.
- Log::setObserver(util::make_unique<FixtureLogObserver>());
+ Log::setObserver(std::make_unique<FixtureLogObserver>());
auto response = std::make_shared<Response>();
response->data = "Demo";
@@ -201,7 +201,7 @@ TEST_F(Storage, DatabaseLockedRefresh) {
{
// Adds a file.
- Log::setObserver(util::make_unique<FixtureLogObserver>());
+ Log::setObserver(std::make_unique<FixtureLogObserver>());
auto response = std::make_shared<Response>();
response->data = "Demo";
@@ -216,7 +216,7 @@ TEST_F(Storage, DatabaseLockedRefresh) {
{
// Then, try to refresh it.
- Log::setObserver(util::make_unique<FixtureLogObserver>());
+ Log::setObserver(std::make_unique<FixtureLogObserver>());
auto response = std::make_shared<Response>();
response->data = "Demo";
@@ -244,7 +244,7 @@ TEST_F(Storage, DatabaseDeleted) {
{
// Adds a file.
- Log::setObserver(util::make_unique<FixtureLogObserver>());
+ Log::setObserver(std::make_unique<FixtureLogObserver>());
auto response = std::make_shared<Response>();
response->data = "Demo";
@@ -260,7 +260,7 @@ TEST_F(Storage, DatabaseDeleted) {
{
// Adds a file.
- Log::setObserver(util::make_unique<FixtureLogObserver>());
+ Log::setObserver(std::make_unique<FixtureLogObserver>());
auto response = std::make_shared<Response>();
response->data = "Demo";
@@ -289,7 +289,7 @@ TEST_F(Storage, DatabaseInvalid) {
{
// Adds a file.
- Log::setObserver(util::make_unique<FixtureLogObserver>());
+ Log::setObserver(std::make_unique<FixtureLogObserver>());
auto response = std::make_shared<Response>();
response->data = "Demo";