summaryrefslogtreecommitdiff
path: root/include
diff options
context:
space:
mode:
authorAlexander Shalamov <alexander.shalamov@mapbox.com>2019-03-04 15:48:26 +0200
committerAlexander Shalamov <alexander.shalamov@mapbox.com>2019-03-04 22:17:37 +0200
commit156038efb2c762eaffb9237a780ef0393e27ceac (patch)
tree0e8d1a7701bf77f6f433c300d8a341fc1bd7f35b /include
parentb1fcbd5b50eb525623c369cd97a75cfcf7078257 (diff)
downloadqtlocation-mapboxgl-156038efb2c762eaffb9237a780ef0393e27ceac.tar.gz
Review comments: minor changes + formattedSection => formattedSectionID
Diffstat (limited to 'include')
-rw-r--r--include/mbgl/style/expression/expression.hpp7
-rw-r--r--include/mbgl/style/expression/formatted.hpp2
-rw-r--r--include/mbgl/style/property_expression.hpp2
3 files changed, 6 insertions, 5 deletions
diff --git a/include/mbgl/style/expression/expression.hpp b/include/mbgl/style/expression/expression.hpp
index d868b17e00..6276b8dc93 100644
--- a/include/mbgl/style/expression/expression.hpp
+++ b/include/mbgl/style/expression/expression.hpp
@@ -35,15 +35,16 @@ public:
zoom(std::move(zoom_)), feature(feature_), colorRampParameter(std::move(colorRampParameter_))
{}
- EvaluationContext& withFormattedSection(const Value* formattedSection_) noexcept {
- formattedSection = formattedSection_;
+ EvaluationContext& withFormattedSectionID(const Value* formattedSectionID_) noexcept {
+ formattedSectionID = formattedSectionID_;
return *this;
};
optional<float> zoom;
GeometryTileFeature const * feature = nullptr;
optional<double> colorRampParameter;
- const Value* formattedSection = nullptr;
+ // Contains formatted section ID (double | std::string)
+ const Value* formattedSectionID = nullptr;
};
template <typename T>
diff --git a/include/mbgl/style/expression/formatted.hpp b/include/mbgl/style/expression/formatted.hpp
index 28964de941..02e2f7c3d0 100644
--- a/include/mbgl/style/expression/formatted.hpp
+++ b/include/mbgl/style/expression/formatted.hpp
@@ -23,7 +23,7 @@ optional<FormattedSectionID> toFormattedSectionID(const Variant& variant) {
return variant.match(
[] (double t) -> FormattedSectionID { return t; },
[] (const std::string& t) -> FormattedSectionID { return t;},
- [] (auto&) -> optional<FormattedSectionID> { return nullopt; });
+ [] (const auto&) -> optional<FormattedSectionID> { return nullopt; });
}
struct FormattedSection {
diff --git a/include/mbgl/style/property_expression.hpp b/include/mbgl/style/property_expression.hpp
index 43e80dfac4..32983e2380 100644
--- a/include/mbgl/style/property_expression.hpp
+++ b/include/mbgl/style/property_expression.hpp
@@ -34,7 +34,7 @@ template <class T>
class PropertyExpression final : public PropertyExpressionBase {
public:
// Second parameter to be used only for conversions from legacy functions.
- PropertyExpression(std::unique_ptr<expression::Expression> expression_, optional<T> defaultValue_ = {})
+ PropertyExpression(std::unique_ptr<expression::Expression> expression_, optional<T> defaultValue_ = nullopt)
: PropertyExpressionBase(std::move(expression_)),
defaultValue(std::move(defaultValue_)) {
}