summaryrefslogtreecommitdiffhomepage
path: root/misc/examples/functor.c
diff options
context:
space:
mode:
authorTyge Lovset <[email protected]>2023-04-08 11:02:39 +0200
committerTyge Lovset <[email protected]>2023-04-08 11:40:12 +0200
commitd92ffe3da29b3352c90b2d356e395914ba5b3f52 (patch)
tree7482f08aeb1a236eb50d5e4a796dbb180b8c0534 /misc/examples/functor.c
parent701b7af4aaf9fe3965c656c500d9200dd7c4831d (diff)
downloadSTC-modified-d92ffe3da29b3352c90b2d356e395914ba5b3f52.tar.gz
STC-modified-d92ffe3da29b3352c90b2d356e395914ba5b3f52.zip
More docs updates, and a change in stc/extend.h.
Diffstat (limited to 'misc/examples/functor.c')
-rw-r--r--misc/examples/functor.c10
1 files changed, 5 insertions, 5 deletions
diff --git a/misc/examples/functor.c b/misc/examples/functor.c
index 7417080b..c0a4f8e8 100644
--- a/misc/examples/functor.c
+++ b/misc/examples/functor.c
@@ -14,10 +14,10 @@
#define i_con cpque
#include <stc/extend.h>
-void print_queue(const char* name, IPQueExt q) {
+void print_queue(const char* name, IPQue_ext q) {
// NB: make a clone because there is no way to traverse
// priority_queue's content without erasing the queue.
- IPQueExt copy = {q.less, IPQue_clone(q.get)};
+ IPQue_ext copy = {q.less, IPQue_clone(q.get)};
for (printf("%s: \t", name); !IPQue_empty(&copy.get); IPQue_pop(&copy.get))
printf("%d ", *IPQue_top(&copy.get));
@@ -38,9 +38,9 @@ int main()
printf("%d ", data[i]);
puts("");
- IPQueExt q1 = {int_less}; // Max priority queue
- IPQueExt minq1 = {int_greater}; // Min priority queue
- IPQueExt q5 = {int_lambda}; // Using lambda to compare elements.
+ IPQue_ext q1 = {int_less}; // Max priority queue
+ IPQue_ext minq1 = {int_greater}; // Min priority queue
+ IPQue_ext q5 = {int_lambda}; // Using lambda to compare elements.
c_forrange (i, n)
IPQue_push(&q1.get, data[i]);