diff options
| author | Tyge Løvset <[email protected]> | 2021-12-22 08:49:19 +0100 |
|---|---|---|
| committer | Tyge Løvset <[email protected]> | 2021-12-22 08:50:15 +0100 |
| commit | 6e65e30c6e3c2bc271d3885e749ceb0289bbd9cf (patch) | |
| tree | ccffa7b7dde19fb551f99c7eed529bdc7308e494 /examples/new_map.c | |
| parent | 1b90b6c3eea0f3e07f8a2d2abe3686917d1d86a8 (diff) | |
| download | STC-modified-6e65e30c6e3c2bc271d3885e749ceb0289bbd9cf.tar.gz STC-modified-6e65e30c6e3c2bc271d3885e749ceb0289bbd9cf.zip | |
Changed the c_apply() and c_apply_pair() to one new c_apply() API. Added c_pair(v) for convenience.
Diffstat (limited to 'examples/new_map.c')
| -rw-r--r-- | examples/new_map.c | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/examples/new_map.c b/examples/new_map.c index 953ca793..1c27d5bf 100644 --- a/examples/new_map.c +++ b/examples/new_map.c @@ -48,19 +48,19 @@ int main() {
cmap_int_insert(&map, 123, 321);
- c_apply_pair(cmap_pnt, insert, &pmap, {
+ c_apply(v, cmap_pnt_insert(&pmap, c_pair(v)), cmap_pnt_rawvalue, {
{{42, 14}, 1}, {{32, 94}, 2}, {{62, 81}, 3}
});
c_foreach (i, cmap_pnt, pmap)
printf(" (%d, %d: %d)", i.ref->first.x, i.ref->first.y, i.ref->second);
puts("");
- c_apply_pair(cmap_str, emplace, &smap, {
+ c_apply(v, cmap_str_emplace(&smap, c_pair(v)), cmap_str_rawvalue, {
{"Hello, friend", "long time no see"},
{"So long, friend", "see you around"},
});
- c_apply(cset_str, emplace, &sset, {
+ c_apply(v, cset_str_emplace(&sset, v), const char*, {
"Hello, friend",
"Nice to see you again",
"So long, friend",
|
