Replace MAPBOX_ETERNAL_CONSTEXPR with constexpr (#2449)
This commit is contained in:
@@ -59,9 +59,8 @@ FeatureExtensionValue getClusterExpansionZoom(std::shared_ptr<style::GeoJSONData
|
||||
return Value{static_cast<uint64_t>(clusterData->getClusterExpansionZoom(clusterID))};
|
||||
}
|
||||
|
||||
MAPBOX_ETERNAL_CONSTEXPR const auto extensionGetters =
|
||||
mapbox::eternal::hash_map<mapbox::eternal::string, FeatureExtensionGetterPtr>(
|
||||
{{"children", &getChildren}, {"leaves", &getLeaves}, {"expansion-zoom", &getClusterExpansionZoom}});
|
||||
constexpr const auto extensionGetters = mapbox::eternal::hash_map<mapbox::eternal::string, FeatureExtensionGetterPtr>(
|
||||
{{"children", &getChildren}, {"leaves", &getLeaves}, {"expansion-zoom", &getClusterExpansionZoom}});
|
||||
|
||||
} // namespace
|
||||
|
||||
|
||||
@@ -988,7 +988,7 @@ const auto& filterInCompoundExpression() {
|
||||
}
|
||||
|
||||
using ParseCompoundFunction = const std::unique_ptr<detail::SignatureBase>& (*)();
|
||||
MAPBOX_ETERNAL_CONSTEXPR const auto compoundExpressionRegistry =
|
||||
constexpr const auto compoundExpressionRegistry =
|
||||
mapbox::eternal::hash_map<mapbox::eternal::string, ParseCompoundFunction>({
|
||||
{"e", eCompoundExpression},
|
||||
{"pi", piCompoundExpression},
|
||||
|
||||
@@ -103,43 +103,43 @@ ParseResult ParsingContext::parse(const Convertible& value,
|
||||
}
|
||||
|
||||
using ParseFunction = ParseResult (*)(const conversion::Convertible&, ParsingContext&);
|
||||
MAPBOX_ETERNAL_CONSTEXPR const auto expressionRegistry =
|
||||
mapbox::eternal::hash_map<mapbox::eternal::string, ParseFunction>({{"==", parseComparison},
|
||||
{"!=", parseComparison},
|
||||
{">", parseComparison},
|
||||
{"<", parseComparison},
|
||||
{">=", parseComparison},
|
||||
{"<=", parseComparison},
|
||||
{"all", All::parse},
|
||||
{"any", Any::parse},
|
||||
{"array", Assertion::parse},
|
||||
{"at", At::parse},
|
||||
{"in", In::parse},
|
||||
{"boolean", Assertion::parse},
|
||||
{"case", Case::parse},
|
||||
{"coalesce", Coalesce::parse},
|
||||
{"collator", CollatorExpression::parse},
|
||||
{"distance", Distance::parse},
|
||||
{"format", FormatExpression::parse},
|
||||
{"image", ImageExpression::parse},
|
||||
{"interpolate", parseInterpolate},
|
||||
{"length", Length::parse},
|
||||
{"let", Let::parse},
|
||||
{"literal", Literal::parse},
|
||||
{"match", parseMatch},
|
||||
{"number", Assertion::parse},
|
||||
{"number-format", NumberFormat::parse},
|
||||
{"object", Assertion::parse},
|
||||
{"step", Step::parse},
|
||||
{"string", Assertion::parse},
|
||||
{"to-boolean", Coercion::parse},
|
||||
{"to-color", Coercion::parse},
|
||||
{"to-number", Coercion::parse},
|
||||
{"to-string", Coercion::parse},
|
||||
{"var", Var::parse},
|
||||
{"within", Within::parse},
|
||||
{"index-of", IndexOf::parse},
|
||||
{"slice", Slice::parse}});
|
||||
constexpr const auto expressionRegistry = mapbox::eternal::hash_map<mapbox::eternal::string, ParseFunction>(
|
||||
{{"==", parseComparison},
|
||||
{"!=", parseComparison},
|
||||
{">", parseComparison},
|
||||
{"<", parseComparison},
|
||||
{">=", parseComparison},
|
||||
{"<=", parseComparison},
|
||||
{"all", All::parse},
|
||||
{"any", Any::parse},
|
||||
{"array", Assertion::parse},
|
||||
{"at", At::parse},
|
||||
{"in", In::parse},
|
||||
{"boolean", Assertion::parse},
|
||||
{"case", Case::parse},
|
||||
{"coalesce", Coalesce::parse},
|
||||
{"collator", CollatorExpression::parse},
|
||||
{"distance", Distance::parse},
|
||||
{"format", FormatExpression::parse},
|
||||
{"image", ImageExpression::parse},
|
||||
{"interpolate", parseInterpolate},
|
||||
{"length", Length::parse},
|
||||
{"let", Let::parse},
|
||||
{"literal", Literal::parse},
|
||||
{"match", parseMatch},
|
||||
{"number", Assertion::parse},
|
||||
{"number-format", NumberFormat::parse},
|
||||
{"object", Assertion::parse},
|
||||
{"step", Step::parse},
|
||||
{"string", Assertion::parse},
|
||||
{"to-boolean", Coercion::parse},
|
||||
{"to-color", Coercion::parse},
|
||||
{"to-number", Coercion::parse},
|
||||
{"to-string", Coercion::parse},
|
||||
{"var", Var::parse},
|
||||
{"within", Within::parse},
|
||||
{"index-of", IndexOf::parse},
|
||||
{"slice", Slice::parse}});
|
||||
|
||||
bool isExpression(const std::string& name) noexcept {
|
||||
return expressionRegistry.contains(name.c_str());
|
||||
|
||||
@@ -166,7 +166,7 @@ constexpr uint8_t toUint8(T t) noexcept {
|
||||
return uint8_t(mbgl::underlying_type(t));
|
||||
}
|
||||
|
||||
MAPBOX_ETERNAL_CONSTEXPR const auto layerProperties = mapbox::eternal::hash_map<mapbox::eternal::string, uint8_t>(
|
||||
constexpr const auto layerProperties = mapbox::eternal::hash_map<mapbox::eternal::string, uint8_t>(
|
||||
{{"background-color", toUint8(Property::BackgroundColor)},
|
||||
{"background-opacity", toUint8(Property::BackgroundOpacity)},
|
||||
{"background-pattern", toUint8(Property::BackgroundPattern)},
|
||||
|
||||
@@ -415,7 +415,7 @@ constexpr uint8_t toUint8(T t) noexcept {
|
||||
return uint8_t(mbgl::underlying_type(t));
|
||||
}
|
||||
|
||||
MAPBOX_ETERNAL_CONSTEXPR const auto layerProperties = mapbox::eternal::hash_map<mapbox::eternal::string, uint8_t>(
|
||||
constexpr const auto layerProperties = mapbox::eternal::hash_map<mapbox::eternal::string, uint8_t>(
|
||||
{{"circle-blur", toUint8(Property::CircleBlur)},
|
||||
{"circle-color", toUint8(Property::CircleColor)},
|
||||
{"circle-opacity", toUint8(Property::CircleOpacity)},
|
||||
|
||||
@@ -311,7 +311,7 @@ constexpr uint8_t toUint8(T t) noexcept {
|
||||
return uint8_t(mbgl::underlying_type(t));
|
||||
}
|
||||
|
||||
MAPBOX_ETERNAL_CONSTEXPR const auto layerProperties = mapbox::eternal::hash_map<mapbox::eternal::string, uint8_t>(
|
||||
constexpr const auto layerProperties = mapbox::eternal::hash_map<mapbox::eternal::string, uint8_t>(
|
||||
{{"fill-extrusion-base", toUint8(Property::FillExtrusionBase)},
|
||||
{"fill-extrusion-color", toUint8(Property::FillExtrusionColor)},
|
||||
{"fill-extrusion-height", toUint8(Property::FillExtrusionHeight)},
|
||||
|
||||
@@ -299,7 +299,7 @@ constexpr uint8_t toUint8(T t) noexcept {
|
||||
return uint8_t(mbgl::underlying_type(t));
|
||||
}
|
||||
|
||||
MAPBOX_ETERNAL_CONSTEXPR const auto layerProperties = mapbox::eternal::hash_map<mapbox::eternal::string, uint8_t>(
|
||||
constexpr const auto layerProperties = mapbox::eternal::hash_map<mapbox::eternal::string, uint8_t>(
|
||||
{{"fill-antialias", toUint8(Property::FillAntialias)},
|
||||
{"fill-color", toUint8(Property::FillColor)},
|
||||
{"fill-opacity", toUint8(Property::FillOpacity)},
|
||||
|
||||
@@ -226,7 +226,7 @@ constexpr uint8_t toUint8(T t) noexcept {
|
||||
return uint8_t(mbgl::underlying_type(t));
|
||||
}
|
||||
|
||||
MAPBOX_ETERNAL_CONSTEXPR const auto layerProperties = mapbox::eternal::hash_map<mapbox::eternal::string, uint8_t>(
|
||||
constexpr const auto layerProperties = mapbox::eternal::hash_map<mapbox::eternal::string, uint8_t>(
|
||||
{{"heatmap-color", toUint8(Property::HeatmapColor)},
|
||||
{"heatmap-intensity", toUint8(Property::HeatmapIntensity)},
|
||||
{"heatmap-opacity", toUint8(Property::HeatmapOpacity)},
|
||||
|
||||
@@ -253,7 +253,7 @@ constexpr uint8_t toUint8(T t) noexcept {
|
||||
return uint8_t(mbgl::underlying_type(t));
|
||||
}
|
||||
|
||||
MAPBOX_ETERNAL_CONSTEXPR const auto layerProperties = mapbox::eternal::hash_map<mapbox::eternal::string, uint8_t>(
|
||||
constexpr const auto layerProperties = mapbox::eternal::hash_map<mapbox::eternal::string, uint8_t>(
|
||||
{{"hillshade-accent-color", toUint8(Property::HillshadeAccentColor)},
|
||||
{"hillshade-exaggeration", toUint8(Property::HillshadeExaggeration)},
|
||||
{"hillshade-highlight-color", toUint8(Property::HillshadeHighlightColor)},
|
||||
|
||||
@@ -229,7 +229,7 @@ constexpr uint8_t toUint8(T t) noexcept {
|
||||
return uint8_t(mbgl::underlying_type(t));
|
||||
}
|
||||
|
||||
MAPBOX_ETERNAL_CONSTEXPR const auto layerProperties = mapbox::eternal::hash_map<mapbox::eternal::string, uint8_t>(
|
||||
constexpr const auto layerProperties = mapbox::eternal::hash_map<mapbox::eternal::string, uint8_t>(
|
||||
{<%- paintProperties.map(p => `{"${p.name}", toUint8(Property::${camelize(p.name)})}`).join(',\n ') %>,
|
||||
<% if (!layoutProperties.length) { -%>
|
||||
<%- paintProperties.map(p => `{"${p.name}-transition", toUint8(Property::${camelize(p.name)}Transition)}`).join(',\n ') %>});
|
||||
|
||||
@@ -480,7 +480,7 @@ constexpr uint8_t toUint8(T t) noexcept {
|
||||
return uint8_t(mbgl::underlying_type(t));
|
||||
}
|
||||
|
||||
MAPBOX_ETERNAL_CONSTEXPR const auto layerProperties = mapbox::eternal::hash_map<mapbox::eternal::string, uint8_t>(
|
||||
constexpr const auto layerProperties = mapbox::eternal::hash_map<mapbox::eternal::string, uint8_t>(
|
||||
{{"line-blur", toUint8(Property::LineBlur)},
|
||||
{"line-color", toUint8(Property::LineColor)},
|
||||
{"line-dasharray", toUint8(Property::LineDasharray)},
|
||||
|
||||
@@ -418,7 +418,7 @@ constexpr uint8_t toUint8(T t) noexcept {
|
||||
return uint8_t(mbgl::underlying_type(t));
|
||||
}
|
||||
|
||||
MAPBOX_ETERNAL_CONSTEXPR const auto layerProperties = mapbox::eternal::hash_map<mapbox::eternal::string, uint8_t>(
|
||||
constexpr const auto layerProperties = mapbox::eternal::hash_map<mapbox::eternal::string, uint8_t>(
|
||||
{{"accuracy-radius", toUint8(Property::AccuracyRadius)},
|
||||
{"accuracy-radius-border-color", toUint8(Property::AccuracyRadiusBorderColor)},
|
||||
{"accuracy-radius-color", toUint8(Property::AccuracyRadiusColor)},
|
||||
|
||||
@@ -311,7 +311,7 @@ constexpr uint8_t toUint8(T t) noexcept {
|
||||
return uint8_t(mbgl::underlying_type(t));
|
||||
}
|
||||
|
||||
MAPBOX_ETERNAL_CONSTEXPR const auto layerProperties = mapbox::eternal::hash_map<mapbox::eternal::string, uint8_t>(
|
||||
constexpr const auto layerProperties = mapbox::eternal::hash_map<mapbox::eternal::string, uint8_t>(
|
||||
{{"raster-brightness-max", toUint8(Property::RasterBrightnessMax)},
|
||||
{"raster-brightness-min", toUint8(Property::RasterBrightnessMin)},
|
||||
{"raster-contrast", toUint8(Property::RasterContrast)},
|
||||
|
||||
@@ -1142,7 +1142,7 @@ constexpr uint8_t toUint8(T t) noexcept {
|
||||
return uint8_t(mbgl::underlying_type(t));
|
||||
}
|
||||
|
||||
MAPBOX_ETERNAL_CONSTEXPR const auto layerProperties = mapbox::eternal::hash_map<mapbox::eternal::string, uint8_t>(
|
||||
constexpr const auto layerProperties = mapbox::eternal::hash_map<mapbox::eternal::string, uint8_t>(
|
||||
{{"icon-color", toUint8(Property::IconColor)},
|
||||
{"icon-halo-blur", toUint8(Property::IconHaloBlur)},
|
||||
{"icon-halo-color", toUint8(Property::IconHaloColor)},
|
||||
|
||||
@@ -56,7 +56,7 @@ constexpr uint8_t toUint8(T t) noexcept {
|
||||
return uint8_t(mbgl::underlying_type(t));
|
||||
}
|
||||
|
||||
MAPBOX_ETERNAL_CONSTEXPR const auto properties = mapbox::eternal::hash_map<mapbox::eternal::string, uint8_t>(
|
||||
constexpr const auto properties = mapbox::eternal::hash_map<mapbox::eternal::string, uint8_t>(
|
||||
{{"anchor", toUint8(Property::Anchor)},
|
||||
{"color", toUint8(Property::Color)},
|
||||
{"intensity", toUint8(Property::Intensity)},
|
||||
|
||||
@@ -54,7 +54,7 @@ constexpr uint8_t toUint8(T t) noexcept {
|
||||
return uint8_t(mbgl::underlying_type(t));
|
||||
}
|
||||
|
||||
MAPBOX_ETERNAL_CONSTEXPR const auto properties = mapbox::eternal::hash_map<mapbox::eternal::string, uint8_t>(
|
||||
constexpr const auto properties = mapbox::eternal::hash_map<mapbox::eternal::string, uint8_t>(
|
||||
{<%- properties.map(p => `{"${p.name}", toUint8(Property::${camelize(p.name)})}`).join(',\n ') %>,
|
||||
<%- properties.map(p => `{"${p.name}-transition", toUint8(Property::${camelize(p.name)}Transition)}`).join(',\n ') %>});
|
||||
|
||||
|
||||
@@ -321,7 +321,7 @@ DEFINE_IS_IN_UNICODE_BLOCK(HalfwidthandFullwidthForms, 0xFF00, 0xFFEF)
|
||||
// DEFINE_IS_IN_UNICODE_BLOCK(SupplementaryPrivateUseAreaA, 0xF0000, 0xFFFFF)
|
||||
// DEFINE_IS_IN_UNICODE_BLOCK(SupplementaryPrivateUseAreaB, 0x100000, 0x10FFFF)
|
||||
|
||||
MAPBOX_ETERNAL_CONSTEXPR const auto verticalPunctuation = mapbox::eternal::map<char16_t, char16_t>({
|
||||
constexpr const auto verticalPunctuation = mapbox::eternal::map<char16_t, char16_t>({
|
||||
{u'!', u'︕'}, {u'#', u'#'}, {u'$', u'$'}, {u'%', u'%'}, {u'&', u'&'}, {u'(', u'︵'}, {u')', u'︶'},
|
||||
{u'*', u'*'}, {u'+', u'+'}, {u',', u'︐'}, {u'-', u'︲'}, {u'.', u'・'}, {u'/', u'/'}, {u':', u'︓'},
|
||||
{u';', u'︔'}, {u'<', u'︿'}, {u'=', u'='}, {u'>', u'﹀'}, {u'?', u'︖'}, {u'@', u'@'}, {u'[', u'﹇'},
|
||||
|
||||
Reference in New Issue
Block a user