summaryrefslogtreecommitdiffhomepage
path: root/examples/box.c
diff options
context:
space:
mode:
authorTyge Løvset <[email protected]>2022-04-27 19:07:18 +0200
committerTyge Løvset <[email protected]>2022-04-27 19:07:18 +0200
commitedfcc712b48e2a582bcad1bc5a4102f18154e549 (patch)
tree70ed252f3bfd4e5841a25d802da630b73e58b800 /examples/box.c
parentdf73eddd7933df7c96269f11e37fc1a96916f747 (diff)
downloadSTC-modified-edfcc712b48e2a582bcad1bc5a4102f18154e549.tar.gz
STC-modified-edfcc712b48e2a582bcad1bc5a4102f18154e549.zip
Final fixes to carc and cbox; Reverted constructor name to make; (similarity to make_shared/make_unique in c++).
Diffstat (limited to 'examples/box.c')
-rw-r--r--examples/box.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/examples/box.c b/examples/box.c
index c50ced1e..423e9cb1 100644
--- a/examples/box.c
+++ b/examples/box.c
@@ -40,7 +40,7 @@ int main()
c_auto (Persons, vec)
c_auto (PBox, p, q)
{
- p = PBox_from(Person_new("Laura", "Palmer"));
+ p = PBox_make(Person_new("Laura", "Palmer"));
q = PBox_clone(p);
cstr_assign(&q.get->name, "Leland");
@@ -48,8 +48,8 @@ int main()
printf("orig: %s %s\n", cstr_str(&p.get->name), cstr_str(&p.get->last));
printf("copy: %s %s\n", cstr_str(&q.get->name), cstr_str(&q.get->last));
- Persons_push_back(&vec, PBox_from(Person_new("Dale", "Cooper")));
- Persons_push_back(&vec, PBox_from(Person_new("Audrey", "Home")));
+ Persons_push_back(&vec, PBox_make(Person_new("Dale", "Cooper")));
+ Persons_push_back(&vec, PBox_make(Person_new("Audrey", "Home")));
// NB! Clone p and q to the vector using emplace_back()
c_apply(v, Persons_push_back(&vec, PBox_clone(v)), PBox, {p, q});