summaryrefslogtreecommitdiff
path: root/include/mbgl/style/expression/literal.hpp
diff options
context:
space:
mode:
authorBruno de Oliveira Abinader <bruno@mapbox.com>2018-07-20 15:40:47 +0300
committerBruno de Oliveira Abinader <bruno@mapbox.com>2018-07-24 10:06:18 +0300
commitcb714d57c5c5ad181aaf5e1690221da8d965682b (patch)
tree21fa8cc6caf1e66de40f9715fa98426e86cfd964 /include/mbgl/style/expression/literal.hpp
parent1683da3225d0cbed3bb6238fd292fa288f6a32d6 (diff)
downloadqtlocation-mapboxgl-cb714d57c5c5ad181aaf5e1690221da8d965682b.tar.gz
[core] Replace expressions RTTI with enums + static cast
Diffstat (limited to 'include/mbgl/style/expression/literal.hpp')
-rw-r--r--include/mbgl/style/expression/literal.hpp7
1 files changed, 4 insertions, 3 deletions
diff --git a/include/mbgl/style/expression/literal.hpp b/include/mbgl/style/expression/literal.hpp
index 44c095bf28..bcae23b1fa 100644
--- a/include/mbgl/style/expression/literal.hpp
+++ b/include/mbgl/style/expression/literal.hpp
@@ -13,12 +13,12 @@ namespace expression {
class Literal : public Expression {
public:
Literal(Value value_)
- : Expression(typeOf(value_))
+ : Expression(Kind::Literal, typeOf(value_))
, value(value_)
{}
Literal(type::Array type_, std::vector<Value> value_)
- : Expression(type_)
+ : Expression(Kind::Literal, type_)
, value(value_)
{}
@@ -31,7 +31,8 @@ public:
void eachChild(const std::function<void(const Expression&)>&) const override {}
bool operator==(const Expression& e) const override {
- if (auto rhs = dynamic_cast<const Literal*>(&e)) {
+ if (e.getKind() == Kind::Literal) {
+ auto rhs = static_cast<const Literal*>(&e);
return value == rhs->value;
}
return false;