Created
May 19, 2020 19:07
-
-
Save vinniefalco/9d885a386623214a903dbaf030c7c14a to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ | |
//[snippet_init_list_7 | |
value jv1 = { { "mercury", 36 }, { "venus", 67 }, { "earth", 93 } }; | |
assert( jv1.is_object() ); | |
assert( to_string(jv1) == "{\"mercury\":36,\"venus\":67,\"earth\":93}" ); | |
array ja = { { "mercury", 36 }, { "venus", 67 }, { "earth", 93 } }; | |
for (value& jv2 : ja) | |
assert( jv2.is_array() ); | |
assert( to_string(ja) == "[[\"mercury\",36],[\"venus\",67],[\"earth\",93]]" ); | |
//] | |
(void)jv1, ja; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment