summaryrefslogtreecommitdiff
path: root/platform/darwin/src/MGLStyleValue_Private.h
diff options
context:
space:
mode:
Diffstat (limited to 'platform/darwin/src/MGLStyleValue_Private.h')
-rw-r--r--platform/darwin/src/MGLStyleValue_Private.h24
1 files changed, 2 insertions, 22 deletions
diff --git a/platform/darwin/src/MGLStyleValue_Private.h b/platform/darwin/src/MGLStyleValue_Private.h
index 84d7ccccec..fee34b4b71 100644
--- a/platform/darwin/src/MGLStyleValue_Private.h
+++ b/platform/darwin/src/MGLStyleValue_Private.h
@@ -307,10 +307,8 @@ private: // Private utilities for converting from mbgl to mgl values
// Enumerations
template <typename MBGLEnum = MBGLType, typename MGLEnum = ObjCEnum>
- static NSValue *toMGLRawStyleValue(const MBGLEnum &value) {
- auto str = mbgl::Enum<MBGLEnum>::toString(value);
- MGLEnum mglType = *mbgl::Enum<MGLEnum>::toEnum(str);
- return [NSValue value:&mglType withObjCType:@encode(MGLEnum)];
+ static NSString *toMGLRawStyleValue(const MBGLEnum &value) {
+ return @(mbgl::Enum<MBGLEnum>::toString(value));
}
/// Converts all types of mbgl property values into an equivalent NSExpression.
@@ -320,15 +318,6 @@ private: // Private utilities for converting from mbgl to mgl values
return nil;
}
- /**
- As hack to allow converting enum => string values, we accept a second, dummy parameter in
- the toRawStyleSpecValue() methods for converting 'atomic' (non-style-function) values.
- This allows us to use `std::enable_if` to test (at compile time) whether or not MBGLType is an Enum.
- */
- template <typename MBGLEnum = MBGLType,
- class = typename std::enable_if<!std::is_enum<MBGLEnum>::value>::type,
- typename MGLEnum = ObjCEnum,
- class = typename std::enable_if<!std::is_enum<MGLEnum>::value>::type>
NSExpression *operator()(const MBGLType &value) const {
id constantValue = toMGLRawStyleValue(value);
if ([constantValue isKindOfClass:[NSArray class]]) {
@@ -337,15 +326,6 @@ private: // Private utilities for converting from mbgl to mgl values
return [NSExpression expressionForConstantValue:constantValue];
}
- template <typename MBGLEnum = MBGLType,
- class = typename std::enable_if<std::is_enum<MBGLEnum>::value>::type,
- typename MGLEnum = ObjCEnum,
- class = typename std::enable_if<std::is_enum<MGLEnum>::value>::type>
- NSExpression *operator()(const MBGLEnum &value) const {
- NSString *constantValue = @(mbgl::Enum<MBGLEnum>::toString(value));
- return [NSExpression expressionForConstantValue:constantValue];
- }
-
NSExpression *operator()(const mbgl::style::PropertyExpression<MBGLType> &mbglValue) const {
return [NSExpression expressionWithMGLJSONObject:MGLJSONObjectFromMBGLExpression(mbglValue.getExpression())];
}