summaryrefslogtreecommitdiff
path: root/include/mbgl/style/conversion/function.hpp
diff options
context:
space:
mode:
Diffstat (limited to 'include/mbgl/style/conversion/function.hpp')
-rw-r--r--include/mbgl/style/conversion/function.hpp22
1 files changed, 2 insertions, 20 deletions
diff --git a/include/mbgl/style/conversion/function.hpp b/include/mbgl/style/conversion/function.hpp
index 49825a3410..ba9acd7a3b 100644
--- a/include/mbgl/style/conversion/function.hpp
+++ b/include/mbgl/style/conversion/function.hpp
@@ -1,8 +1,8 @@
#pragma once
#include <mbgl/style/property_expression.hpp>
-#include <mbgl/style/conversion.hpp>
#include <mbgl/style/conversion/constant.hpp>
+#include <mbgl/style/conversion.hpp>
#include <mbgl/style/expression/expression.hpp>
#include <mbgl/style/expression/value.hpp>
@@ -16,25 +16,7 @@ std::unique_ptr<expression::Expression> convertTokenStringToExpression(const std
optional<std::unique_ptr<expression::Expression>> convertFunctionToExpression(expression::type::Type, const Convertible&, Error&, bool convertTokens);
template <class T>
-optional<PropertyExpression<T>> convertFunctionToExpression(const Convertible& value, Error& error, bool convertTokens) {
- auto expression = convertFunctionToExpression(expression::valueTypeToExpressionType<T>(), value, error, convertTokens);
- if (!expression) {
- return nullopt;
- }
-
- optional<T> defaultValue;
-
- auto defaultValueValue = objectMember(value, "default");
- if (defaultValueValue) {
- defaultValue = convert<T>(*defaultValueValue, error);
- if (!defaultValue) {
- error.message = R"(wrong type for "default": )" + error.message;
- return nullopt;
- }
- }
-
- return PropertyExpression<T>(std::move(*expression), defaultValue);
-}
+optional<PropertyExpression<T>> convertFunctionToExpression(const Convertible& value, Error& error, bool convertTokens);
} // namespace conversion
} // namespace style