diff options
author | Konstantin Käfer <mail@kkaefer.com> | 2015-07-02 13:28:54 +0200 |
---|---|---|
committer | Konstantin Käfer <mail@kkaefer.com> | 2015-07-08 19:46:01 +0200 |
commit | 6271f8e5466e979806415a74581fdd293930950e (patch) | |
tree | 694556d0c90003d8e5bdb0a42427f6f84d288a1e /include/mbgl/util | |
parent | bc41d3cf6d0b5c635f856d95acd0d4941802f51f (diff) | |
download | qtlocation-mapboxgl-6271f8e5466e979806415a74581fdd293930950e.tar.gz |
mark Image constructor as explicit to avoid accidental implicit argument conversion
when passing a std::string instead of an Image, the parameter gets implicitly and automatically converted (== parsed) to a temporary Image object. Since parsing an Image shouldn't be a frequent operation
Diffstat (limited to 'include/mbgl/util')
-rw-r--r-- | include/mbgl/util/image.hpp | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/include/mbgl/util/image.hpp b/include/mbgl/util/image.hpp index 91a451890f..f58c2c0989 100644 --- a/include/mbgl/util/image.hpp +++ b/include/mbgl/util/image.hpp @@ -12,7 +12,7 @@ std::string compress_png(int width, int height, const void *rgba); class Image { public: - Image(const std::string &img); + explicit Image(const std::string &img); inline const char *getData() const { return img.get(); } inline uint32_t getWidth() const { return width; } |