summaryrefslogtreecommitdiffhomepage
path: root/docs/cmap_api.md
diff options
context:
space:
mode:
authorTyge Løvset <[email protected]>2021-12-22 08:49:19 +0100
committerTyge Løvset <[email protected]>2021-12-22 08:50:15 +0100
commit6e65e30c6e3c2bc271d3885e749ceb0289bbd9cf (patch)
treeccffa7b7dde19fb551f99c7eed529bdc7308e494 /docs/cmap_api.md
parent1b90b6c3eea0f3e07f8a2d2abe3686917d1d86a8 (diff)
downloadSTC-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 'docs/cmap_api.md')
-rw-r--r--docs/cmap_api.md6
1 files changed, 3 insertions, 3 deletions
diff --git a/docs/cmap_api.md b/docs/cmap_api.md
index b05ae5a8..b7a08e3e 100644
--- a/docs/cmap_api.md
+++ b/docs/cmap_api.md
@@ -122,7 +122,7 @@ int main()
// Create an unordered_map of three strings (that map to strings)
c_auto (cmap_str, u)
{
- c_apply_pair(cmap_str, emplace, &u, {
+ c_apply(v, cmap_str_emplace(&u, c_pair(v)), cmap_str_rawvalue, {
{"RED", "#FF0000"},
{"GREEN", "#00FF00"},
{"BLUE", "#0000FF"}
@@ -168,7 +168,7 @@ int main()
c_auto (cmap_id, idnames)
{
- c_apply_pair(cmap_id, emplace, &idnames, {
+ c_apply(v, cmap_id_emplace(&idnames, c_pair(v)), cmap_id_rawvalue, {
{100, "Red"}, {110, "Blue"}
});
// replace existing mapped value:
@@ -384,7 +384,7 @@ static inline RViking Viking_toraw(const Viking* vk) {
int main()
{
c_auto (Vikings, vikings) {
- c_apply_pair(Vikings, emplace, &vikings, {
+ c_apply(v, Vikings_emplace(&vikings, v), c_pair(v), Vikings_rawvalue, {
{{"Einar", "Norway"}, 20},
{{"Olaf", "Denmark"}, 24},
{{"Harald", "Iceland"}, 12},