Update json.cpp
Fix "Conversion from brace-enclosed initializer list to std::tuple is ambiguous."
This commit is contained in:
@@ -167,7 +167,7 @@ namespace jjx::json {
|
||||
if (auto [token, new_index, error] = lexer(raw_json, i); i != new_index) {
|
||||
// Error while lexing, return early
|
||||
if (error.length()) {
|
||||
return {{}, error};
|
||||
return std::make_tuple(std::vector<jjx::json::token>{}, error);
|
||||
}
|
||||
|
||||
// Store reference to the original source
|
||||
@@ -182,7 +182,7 @@ namespace jjx::json {
|
||||
if (found) {
|
||||
continue;
|
||||
}
|
||||
return {{}, format_error("Unable to lex", raw_json, i)};
|
||||
return std::make_tuple(std::vector<jjx::json::token>{}, format_error("Unable to lex", raw_json, i));
|
||||
}
|
||||
return {tokens, ""};
|
||||
}
|
||||
@@ -328,7 +328,7 @@ namespace jjx::json {
|
||||
auto [tokens, error] = json::lex(source);
|
||||
if (error.size())
|
||||
{
|
||||
return {{}, error};
|
||||
return std::make_tuple(jjx::json::value{}, error);
|
||||
}
|
||||
|
||||
auto [ast, _, error1] = json::parse(tokens);
|
||||
|
Reference in New Issue
Block a user