summaryrefslogtreecommitdiff
path: root/include/mbgl/style/expression/type.hpp
diff options
context:
space:
mode:
Diffstat (limited to 'include/mbgl/style/expression/type.hpp')
-rw-r--r--include/mbgl/style/expression/type.hpp26
1 files changed, 13 insertions, 13 deletions
diff --git a/include/mbgl/style/expression/type.hpp b/include/mbgl/style/expression/type.hpp
index 21b01234c6..25c07ef501 100644
--- a/include/mbgl/style/expression/type.hpp
+++ b/include/mbgl/style/expression/type.hpp
@@ -15,49 +15,49 @@ template <class T>
std::string toString(const T& t);
struct NullType {
- constexpr NullType() {}
+ constexpr NullType() = default;
std::string getName() const { return "Null"; }
bool operator==(const NullType&) const { return true; }
};
struct NumberType {
- constexpr NumberType() {}
+ constexpr NumberType() = default;
std::string getName() const { return "Number"; }
bool operator==(const NumberType&) const { return true; }
};
struct BooleanType {
- constexpr BooleanType() {}
+ constexpr BooleanType() = default;
std::string getName() const { return "Boolean"; }
bool operator==(const BooleanType&) const { return true; }
};
struct StringType {
- constexpr StringType() {}
+ constexpr StringType() = default;
std::string getName() const { return "String"; }
bool operator==(const StringType&) const { return true; }
};
struct ColorType {
- constexpr ColorType() {}
+ constexpr ColorType() = default;
std::string getName() const { return "Color"; }
bool operator==(const ColorType&) const { return true; }
};
struct ObjectType {
- constexpr ObjectType() {}
+ constexpr ObjectType() = default;
std::string getName() const { return "Object"; }
bool operator==(const ObjectType&) const { return true; }
};
struct ErrorType {
- constexpr ErrorType() {}
+ constexpr ErrorType() = default;
std::string getName() const { return "Error"; }
bool operator==(const ErrorType&) const { return true; }
};
struct ValueType {
- constexpr ValueType() {}
+ constexpr ValueType() = default;
std::string getName() const { return "Value"; }
bool operator==(const ValueType&) const { return true; }
};
@@ -85,9 +85,9 @@ using Type = variant<
ErrorType>;
struct Array {
- Array(Type itemType_) : itemType(itemType_) {}
- Array(Type itemType_, std::size_t N_) : itemType(itemType_), N(N_) {}
- Array(Type itemType_, optional<std::size_t> N_) : itemType(itemType_), N(N_) {}
+ Array(Type itemType_) : itemType(std::move(itemType_)) {}
+ Array(Type itemType_, std::size_t N_) : itemType(std::move(itemType_)), N(N_) {}
+ Array(Type itemType_, optional<std::size_t> N_) : itemType(std::move(itemType_)), N(std::move(N_)) {}
std::string getName() const {
if (N) {
return "Array<" + toString(itemType) + ", " + std::to_string(*N) + ">";
@@ -103,9 +103,9 @@ struct Array {
Type itemType;
optional<std::size_t> N;
};
-
+
template <class T>
-std::string toString(const T& t) { return t.match([&] (const auto& t) { return t.getName(); }); }
+std::string toString(const T& type) { return type.match([&] (const auto& t) { return t.getName(); }); }
} // namespace type
} // namespace expression