diff --git a/include/mbgl/gl/custom_layer.hpp b/include/mbgl/gl/custom_layer.hpp index 8b60af5d7..f879cda80 100644 --- a/include/mbgl/gl/custom_layer.hpp +++ b/include/mbgl/gl/custom_layer.hpp @@ -61,7 +61,7 @@ public: virtual void deinitialize() = 0; }; -class CustomLayer : public Layer { +class CustomLayer final : public Layer { public: CustomLayer(const std::string& id, std::unique_ptr host); diff --git a/include/mbgl/style/filter.hpp b/include/mbgl/style/filter.hpp index e0623a20d..5e14bccac 100644 --- a/include/mbgl/style/filter.hpp +++ b/include/mbgl/style/filter.hpp @@ -18,8 +18,8 @@ public: private: optional legacyFilter; public: - Filter() : expression() {} - + Filter() {} + Filter(expression::ParseResult _expression, optional _filter = {}) : expression(std::move(*_expression)), legacyFilter(std::move(_filter)){ diff --git a/include/mbgl/style/layers/background_layer.hpp b/include/mbgl/style/layers/background_layer.hpp index 2a46b2fc2..4143f2312 100644 --- a/include/mbgl/style/layers/background_layer.hpp +++ b/include/mbgl/style/layers/background_layer.hpp @@ -14,7 +14,7 @@ namespace style { class TransitionOptions; -class BackgroundLayer : public Layer { +class BackgroundLayer final : public Layer { public: BackgroundLayer(const std::string& layerID); ~BackgroundLayer() final; diff --git a/include/mbgl/style/layers/circle_layer.hpp b/include/mbgl/style/layers/circle_layer.hpp index aac02121e..370d2aa8b 100644 --- a/include/mbgl/style/layers/circle_layer.hpp +++ b/include/mbgl/style/layers/circle_layer.hpp @@ -14,7 +14,7 @@ namespace style { class TransitionOptions; -class CircleLayer : public Layer { +class CircleLayer final : public Layer { public: CircleLayer(const std::string& layerID, const std::string& sourceID); ~CircleLayer() final; diff --git a/include/mbgl/style/layers/fill_extrusion_layer.hpp b/include/mbgl/style/layers/fill_extrusion_layer.hpp index 3e4973b82..a62a8a0fd 100644 --- a/include/mbgl/style/layers/fill_extrusion_layer.hpp +++ b/include/mbgl/style/layers/fill_extrusion_layer.hpp @@ -14,7 +14,7 @@ namespace style { class TransitionOptions; -class FillExtrusionLayer : public Layer { +class FillExtrusionLayer final : public Layer { public: FillExtrusionLayer(const std::string& layerID, const std::string& sourceID); ~FillExtrusionLayer() final; diff --git a/include/mbgl/style/layers/fill_layer.hpp b/include/mbgl/style/layers/fill_layer.hpp index fb386c4b1..3c3c54220 100644 --- a/include/mbgl/style/layers/fill_layer.hpp +++ b/include/mbgl/style/layers/fill_layer.hpp @@ -14,7 +14,7 @@ namespace style { class TransitionOptions; -class FillLayer : public Layer { +class FillLayer final : public Layer { public: FillLayer(const std::string& layerID, const std::string& sourceID); ~FillLayer() final; diff --git a/include/mbgl/style/layers/heatmap_layer.hpp b/include/mbgl/style/layers/heatmap_layer.hpp index 371e9a8aa..ec6c39766 100644 --- a/include/mbgl/style/layers/heatmap_layer.hpp +++ b/include/mbgl/style/layers/heatmap_layer.hpp @@ -15,7 +15,7 @@ namespace style { class TransitionOptions; -class HeatmapLayer : public Layer { +class HeatmapLayer final : public Layer { public: HeatmapLayer(const std::string& layerID, const std::string& sourceID); ~HeatmapLayer() final; diff --git a/include/mbgl/style/layers/hillshade_layer.hpp b/include/mbgl/style/layers/hillshade_layer.hpp index 7149fb46d..784818265 100644 --- a/include/mbgl/style/layers/hillshade_layer.hpp +++ b/include/mbgl/style/layers/hillshade_layer.hpp @@ -14,7 +14,7 @@ namespace style { class TransitionOptions; -class HillshadeLayer : public Layer { +class HillshadeLayer final : public Layer { public: HillshadeLayer(const std::string& layerID, const std::string& sourceID); ~HillshadeLayer() final; diff --git a/include/mbgl/style/layers/layer.hpp.ejs b/include/mbgl/style/layers/layer.hpp.ejs index a81aaa9e1..1a0f557e9 100644 --- a/include/mbgl/style/layers/layer.hpp.ejs +++ b/include/mbgl/style/layers/layer.hpp.ejs @@ -32,7 +32,7 @@ namespace style { class TransitionOptions; -class <%- camelize(type) %>Layer : public Layer { +class <%- camelize(type) %>Layer final : public Layer { public: <% if ((type === 'background') || (type === 'location-indicator')) { -%> <%- camelize(type) %>Layer(const std::string& layerID); diff --git a/include/mbgl/style/layers/line_layer.hpp b/include/mbgl/style/layers/line_layer.hpp index 7d7da47bf..13a58f45d 100644 --- a/include/mbgl/style/layers/line_layer.hpp +++ b/include/mbgl/style/layers/line_layer.hpp @@ -17,7 +17,7 @@ namespace style { class TransitionOptions; -class LineLayer : public Layer { +class LineLayer final : public Layer { public: LineLayer(const std::string& layerID, const std::string& sourceID); ~LineLayer() final; diff --git a/include/mbgl/style/layers/location_indicator_layer.hpp b/include/mbgl/style/layers/location_indicator_layer.hpp index 49720a240..fcf688fb9 100644 --- a/include/mbgl/style/layers/location_indicator_layer.hpp +++ b/include/mbgl/style/layers/location_indicator_layer.hpp @@ -15,10 +15,10 @@ namespace style { class TransitionOptions; -class LocationIndicatorLayer : public Layer { +class LocationIndicatorLayer final : public Layer { public: LocationIndicatorLayer(const std::string& layerID); - ~LocationIndicatorLayer() final; + ~LocationIndicatorLayer(); // Layout properties diff --git a/include/mbgl/style/layers/raster_layer.hpp b/include/mbgl/style/layers/raster_layer.hpp index 78fa3db23..3ccda2d68 100644 --- a/include/mbgl/style/layers/raster_layer.hpp +++ b/include/mbgl/style/layers/raster_layer.hpp @@ -14,7 +14,7 @@ namespace style { class TransitionOptions; -class RasterLayer : public Layer { +class RasterLayer final : public Layer { public: RasterLayer(const std::string& layerID, const std::string& sourceID); ~RasterLayer() final; diff --git a/include/mbgl/style/layers/symbol_layer.hpp b/include/mbgl/style/layers/symbol_layer.hpp index 40d16dedf..355299ce5 100644 --- a/include/mbgl/style/layers/symbol_layer.hpp +++ b/include/mbgl/style/layers/symbol_layer.hpp @@ -17,7 +17,7 @@ namespace style { class TransitionOptions; -class SymbolLayer : public Layer { +class SymbolLayer final : public Layer { public: SymbolLayer(const std::string& layerID, const std::string& sourceID); ~SymbolLayer() final; diff --git a/include/mbgl/util/tileset.hpp b/include/mbgl/util/tileset.hpp index c0885e0eb..c6e41fc4a 100644 --- a/include/mbgl/util/tileset.hpp +++ b/include/mbgl/util/tileset.hpp @@ -33,8 +33,7 @@ public: zoomRange(zoomRange_), attribution(std::move(attribution_)), scheme(scheme_), - encoding(encoding_), - bounds(){}; + encoding(encoding_){}; // TileJSON also includes center and zoom but they are not used by mbgl. diff --git a/platform/default/include/mbgl/storage/file_source_request.hpp b/platform/default/include/mbgl/storage/file_source_request.hpp index 6bd0d44df..79ad53ff2 100644 --- a/platform/default/include/mbgl/storage/file_source_request.hpp +++ b/platform/default/include/mbgl/storage/file_source_request.hpp @@ -11,7 +11,7 @@ namespace mbgl { class Mailbox; -class FileSourceRequest : public AsyncRequest { +class FileSourceRequest final : public AsyncRequest { public: FileSourceRequest(FileSource::Callback&& callback); ~FileSourceRequest() final; diff --git a/platform/linux/src/headless_backend_glx.cpp b/platform/linux/src/headless_backend_glx.cpp index 63eafc9a5..4bb503a8a 100644 --- a/platform/linux/src/headless_backend_glx.cpp +++ b/platform/linux/src/headless_backend_glx.cpp @@ -71,7 +71,7 @@ public: GLXFBConfig* fbConfigs = nullptr; }; -class GLXBackendImpl : public HeadlessBackend::Impl { +class GLXBackendImpl final : public HeadlessBackend::Impl { public: GLXBackendImpl() { // Try to create a legacy context. diff --git a/src/mbgl/map/map_impl.hpp b/src/mbgl/map/map_impl.hpp index 416662f9e..022909c8d 100644 --- a/src/mbgl/map/map_impl.hpp +++ b/src/mbgl/map/map_impl.hpp @@ -26,7 +26,7 @@ struct StillImageRequest { Map::StillImageCallback callback; }; -class Map::Impl : public style::Observer, public RendererObserver { +class Map::Impl final : public style::Observer, public RendererObserver { public: Impl(RendererFrontend&, MapObserver&, std::shared_ptr, const MapOptions&); ~Impl() final; diff --git a/src/mbgl/renderer/property_evaluation_parameters.hpp b/src/mbgl/renderer/property_evaluation_parameters.hpp index 59e96d784..d6cbf9d15 100644 --- a/src/mbgl/renderer/property_evaluation_parameters.hpp +++ b/src/mbgl/renderer/property_evaluation_parameters.hpp @@ -17,7 +17,7 @@ public: explicit PropertyEvaluationParameters(float z_) : z(z_), now(Clock::time_point::max()), - zoomHistory(), + defaultFadeDuration(0) {} PropertyEvaluationParameters(ZoomHistory zoomHistory_, TimePoint now_, Duration defaultFadeDuration_) diff --git a/src/mbgl/style/sources/geojson_source_impl.hpp b/src/mbgl/style/sources/geojson_source_impl.hpp index 3b106e3c0..fd23ebdbe 100644 --- a/src/mbgl/style/sources/geojson_source_impl.hpp +++ b/src/mbgl/style/sources/geojson_source_impl.hpp @@ -11,7 +11,7 @@ class CanonicalTileID; namespace style { -class GeoJSONSource::Impl : public Source::Impl { +class GeoJSONSource::Impl final : public Source::Impl { public: Impl(std::string id, Immutable); Impl(const GeoJSONSource::Impl&, std::shared_ptr); diff --git a/src/mbgl/style/sources/image_source_impl.hpp b/src/mbgl/style/sources/image_source_impl.hpp index d78446470..16ddcfda7 100644 --- a/src/mbgl/style/sources/image_source_impl.hpp +++ b/src/mbgl/style/sources/image_source_impl.hpp @@ -9,7 +9,7 @@ namespace mbgl { namespace style { -class ImageSource::Impl : public Source::Impl { +class ImageSource::Impl final : public Source::Impl { public: Impl(std::string id, std::array coords); Impl(const Impl& other, std::array coords); diff --git a/src/mbgl/tile/geometry_tile_data.hpp b/src/mbgl/tile/geometry_tile_data.hpp index fc0790db8..7d172e494 100644 --- a/src/mbgl/tile/geometry_tile_data.hpp +++ b/src/mbgl/tile/geometry_tile_data.hpp @@ -25,6 +25,7 @@ public: template GeometryCoordinates(Args&&... args) : std::vector(std::forward(args)...) {} GeometryCoordinates(std::initializer_list args) : std::vector(args) {} + GeometryCoordinates() = default; }; class GeometryCollection : public std::vector { @@ -35,6 +36,7 @@ public: GeometryCollection(std::initializer_list args) : std::vector(args) {} GeometryCollection(GeometryCollection&&) = default; GeometryCollection& operator=(GeometryCollection&&) = default; + GeometryCollection() = default; GeometryCollection clone() const { return GeometryCollection(*this); }