Open thomasreiser opened 5 years ago
Same error also present in MSVC 2019.
I haven't fully tested it yet, but I modified the code for it to compile and run:
template <>
value convert<value>(const rapidjson_value &json) {
struct mapbox::feature::value newValue;
switch (json.GetType()) {
case rapidjson::kNullType:
newValue.set<mapbox::feature::null_value_t>();
return newValue;
case rapidjson::kFalseType:
newValue.set<bool>(false);
return newValue;
case rapidjson::kTrueType:
newValue.set<bool>(true);
return newValue;
case rapidjson::kObjectType:
newValue.set<std::unordered_map<std::string, value>>(convert<prop_map>(json));
return newValue;
case rapidjson::kArrayType:
newValue.set<std::vector<value>>(convert<std::vector<value>>(json));
return newValue;
case rapidjson::kStringType:
newValue.set<std::string>(std::string(json.GetString(), json.GetStringLength()));
return newValue;
default:
assert(json.GetType() == rapidjson::kNumberType);
if (json.IsUint64()) {
newValue.set<std::uint64_t>(json.GetUint64());
return newValue;
}
if (json.IsInt64()) {
newValue.set<std::uint64_t>(json.GetInt64());
return newValue;
}
newValue.set<std::double_t>(json.GetDouble());
return newValue;
}
}
from
template <>
value convert<value>(const rapidjson_value &json) {
switch (json.GetType()) {
case rapidjson::kNullType:
return null_value_t{};
case rapidjson::kFalseType:
return false;
case rapidjson::kTrueType:
return true;
case rapidjson::kObjectType:
return convert<prop_map>(json);
case rapidjson::kArrayType:
return convert<std::vector<value>>(json);
case rapidjson::kStringType:
return std::string(json.GetString(), json.GetStringLength());
default:
assert(json.GetType() == rapidjson::kNumberType);
if (json.IsUint64())
return std::uint64_t(json.GetUint64());
if (json.IsInt64())
return std::int64_t(json.GetInt64());
return json.GetDouble();
}
}
When trying to compile geojson_impl.hpp with Visual Studio 2017 (64 bit), I am getting the following errors: