diff options
| author | Tyge Lovset <[email protected]> | 2023-03-29 08:45:28 +0200 |
|---|---|---|
| committer | Tyge Lovset <[email protected]> | 2023-03-29 08:45:28 +0200 |
| commit | 97d205f7ba096a9872afbce5e696a8806d7b72d1 (patch) | |
| tree | 27d1b31ed756a8a74157e48a27bcb506d66e097a /misc/examples/functor.c | |
| parent | 4f0ca428e332761666916477b22c3301044a85c6 (diff) | |
| download | STC-modified-97d205f7ba096a9872afbce5e696a8806d7b72d1.tar.gz STC-modified-97d205f7ba096a9872afbce5e696a8806d7b72d1.zip | |
Removed i_less_functor, i_cmp_functor, i_eq_functor and i_hash_functor: not needed.
Simplified cvec_X_eq() and cdeq_X_eq()
Diffstat (limited to 'misc/examples/functor.c')
| -rw-r--r-- | misc/examples/functor.c | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/misc/examples/functor.c b/misc/examples/functor.c index f37e41d5..f8074c3a 100644 --- a/misc/examples/functor.c +++ b/misc/examples/functor.c @@ -1,9 +1,9 @@ // Implements c++ example: https://en.cppreference.com/w/cpp/container/priority_queue // Example of per-instance less-function on a single priority queue type // -// Note: i_less_functor: available for cpque types only -// i_cmp_functor: available for csmap and csset types only -// i_hash_functor/i_eq_functor: available for cmap and cset types only +// Note: i_less: has self for cpque types only +// i_cmp: has self for csmap and csset types only +// i_hash/i_eq: has self for cmap and cset types only #include <stdio.h> #include <stdbool.h> @@ -23,7 +23,7 @@ struct { #define i_type ipque #define i_val int #define i_opt c_is_forward // needed to avoid re-type-define container type -#define i_less_functor(self, x, y) c_container_of(self, IPQueue, Q)->less(x, y) +#define i_less(x, y) c_container_of(self, IPQueue, Q)->less(x, y) #include <stc/cpque.h> void print_queue(const char* name, IPQueue q) { |
