You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
free functions for explicit objects and arrays in initializer lists #8
I can't say it's a great solution, but in JSON Voorhees, I went with free functions called array and object to disambiguate the initializer_list syntax. It also solves the issue of {} ambiguously meaning an empty object or empty array (and accidentally making an array when given string_views or something).
Such free functions could solve the above problem:
Activity
worked on issue #8 and #27
nlohmann commentedon Jan 24, 2015
The array
can now be created with
{json::array({"a", "b"}), json::array({"c", "d"})}Thereby
json::arrayandjson::objectare functions to force a type in an initializer list.external_constructor<std::valarray>: Handle empty array properly
parser::sax_parse_internal: Avoid integer conversion warning
external_constructor<std::valarray>: Handle empty array properly
.travis/cmake: Rework clang santizer invocation
external_constructor<std::valarray>: Handle empty array properly
.travis/cmake: Rework clang sanitizer invocation
external_constructor<std::valarray>: Handle empty array properly
.travis/cmake: Rework clang sanitizer invocation
external_constructor<std::valarray>: Handle empty array properly
.travis/cmake: Rework clang sanitizer invocation
external_constructor<std::valarray>: Handle empty array properly
Merge pull request nlohmann#8 from nlohmann/develop
TT_CHANGES checklist answers (#8)