diff options
Diffstat (limited to 'pk.h.in')
| -rw-r--r-- | pk.h.in | 21 |
1 files changed, 21 insertions, 0 deletions
@@ -251,6 +251,27 @@ * arr.~pk_bkt_arr<int>(); // manually call dtor for globals * ``` * +******************************************************************************** +* pktmpl.h: only contains c++ templates, no IMPL. +* +* Provides template structs for trampolines, allowing c-style callbacks with +* capturing lambdas. +* +* Examples: +* ```c++ +* int some_counter = 0; +* using IterCbWrapper = pk_tmpln_1<void, int*, void*>; +* IterCbWrapper cb_wrapper{}; +* cb_wrapper.func = [&some_counter](int *lhs) +* { +* (void)lhs; +* some_counter += 1; +* return; +* }; +* pk_bkt_arr_iterate(&bkt_arr, &IterCbWrapper::invoke, &cb_wrapper); +* assert(some_count == 1); +* ``` +* *******************************************************************************/ #define PK_VERSION "@@PK_VERSION@@" |
