diff options
author | Ivo van Dongen <info@ivovandongen.nl> | 2017-01-31 15:44:18 +0200 |
---|---|---|
committer | John Firebaugh <john.firebaugh@gmail.com> | 2017-02-02 09:44:42 -0800 |
commit | 8a5bff8ee630673c6ebc496322eab94a41ae9353 (patch) | |
tree | 8bb6428cd9c3d591c237d77f94d4b0e56efb0ee0 /include/mbgl/style/function/categorical_stops.hpp | |
parent | 141e995806576364d185626176c1b993fc519291 (diff) | |
download | qtlocation-mapboxgl-8a5bff8ee630673c6ebc496322eab94a41ae9353.tar.gz |
[core] default value support in categorical function conversion
Diffstat (limited to 'include/mbgl/style/function/categorical_stops.hpp')
-rw-r--r-- | include/mbgl/style/function/categorical_stops.hpp | 10 |
1 files changed, 4 insertions, 6 deletions
diff --git a/include/mbgl/style/function/categorical_stops.hpp b/include/mbgl/style/function/categorical_stops.hpp index 11ec2a0e5a..c8505115ab 100644 --- a/include/mbgl/style/function/categorical_stops.hpp +++ b/include/mbgl/style/function/categorical_stops.hpp @@ -21,20 +21,18 @@ public: using Stops = std::map<CategoricalValue, T>; Stops stops; - T defaultValue; CategoricalStops() = default; - CategoricalStops(Stops stops_, T defaultValue_ = T()) - : stops(std::move(stops_)), - defaultValue(std::move(defaultValue_)) { + CategoricalStops(Stops stops_) + : stops(std::move(stops_)) { assert(stops.size() > 0); } - T evaluate(const Value&) const; + optional<T> evaluate(const Value&) const; friend bool operator==(const CategoricalStops& lhs, const CategoricalStops& rhs) { - return lhs.stops == rhs.stops && lhs.defaultValue == rhs.defaultValue; + return lhs.stops == rhs.stops; } }; |