diff options
| author | Tyge Løvset <[email protected]> | 2023-03-26 22:33:45 +0200 |
|---|---|---|
| committer | Tyge Løvset <[email protected]> | 2023-03-26 22:33:45 +0200 |
| commit | ede39bc98a758674485796174ea860515ec281e6 (patch) | |
| tree | 9cf3cb80a09be277d1581345701d54dda6ecd4f6 /include/stc/csmap.h | |
| parent | f2f9eaab3e347d04dfa98978e20fcdcdcb38c72d (diff) | |
| download | STC-modified-ede39bc98a758674485796174ea860515ec281e6.tar.gz STC-modified-ede39bc98a758674485796174ea860515ec281e6.zip | |
Remove more c_with, c_auto
Diffstat (limited to 'include/stc/csmap.h')
| -rw-r--r-- | include/stc/csmap.h | 28 |
1 files changed, 14 insertions, 14 deletions
diff --git a/include/stc/csmap.h b/include/stc/csmap.h index 0f72ca2d..2b1910e9 100644 --- a/include/stc/csmap.h +++ b/include/stc/csmap.h @@ -32,20 +32,20 @@ #include <stc/csmap.h> int main(void) { - c_with (csmap_sx m = csmap_sx_init(), csmap_sx_drop(&m)) - { - csmap_sx_emplace(&m, "Testing one", 1.234); - csmap_sx_emplace(&m, "Testing two", 12.34); - csmap_sx_emplace(&m, "Testing three", 123.4); - - csmap_sx_value *v = csmap_sx_get(&m, "Testing five"); // NULL - double num = *csmap_sx_at(&m, "Testing one"); - csmap_sx_emplace_or_assign(&m, "Testing three", 1000.0); // update - csmap_sx_erase(&m, "Testing two"); - - c_foreach (i, csmap_sx, m) - printf("map %s: %g\n", cstr_str(&i.ref->first), i.ref->second); - } + csmap_sx m = {0}; + csmap_sx_emplace(&m, "Testing one", 1.234); + csmap_sx_emplace(&m, "Testing two", 12.34); + csmap_sx_emplace(&m, "Testing three", 123.4); + + csmap_sx_value *v = csmap_sx_get(&m, "Testing five"); // NULL + double num = *csmap_sx_at(&m, "Testing one"); + csmap_sx_emplace_or_assign(&m, "Testing three", 1000.0); // update + csmap_sx_erase(&m, "Testing two"); + + c_foreach (i, csmap_sx, m) + printf("map %s: %g\n", cstr_str(&i.ref->first), i.ref->second); + + csmap_sx_drop(&m); } */ #ifdef STC_CSMAP_V1 |
