duck-typed object input adapters

This commit is contained in:
Francois Chabot 2020-02-19 14:59:31 -05:00
parent a0c4fc945a
commit 2e2cf02cfd
8 changed files with 202 additions and 207 deletions

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();
}
}