-
-
Notifications
You must be signed in to change notification settings - Fork 7.1k
Closed
Description
Currently,
{{"a","b"},{"c","d"}}
will be treated as object, and there is no way to express it as array of two arrays with two strings each.
As tgockel points out:
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:
{array({"a","b"}), array({"c","d"})}