duck-typed object input adapters

This commit is contained in:
Francois Chabot committed 2020-02-19 14:59:31 -05:00
1 parent a0c4fc945a
commit 2e2cf02cfd
8 files changed
+202 -207

No files matched your search

+2 -3
View File
@@ -39,9 +39,8 @@ namespace
// shortcut to scan a string literal
json::lexer::token_type scan_string(const char* s)
{
auto input_adapter = nlohmann::detail::input_adapter(s);
using input_adapter_type = typename decltype(input_adapter)::element_type;
return nlohmann::detail::lexer<json, input_adapter_type>(std::move(input_adapter)).scan();
auto ia = nlohmann::detail::input_adapter(s);
return nlohmann::detail::lexer<json, decltype(ia)>(std::move(ia)).scan();
}
}