While it is trivially simple to define some struct with callback functions, such a definition turns out to be obnoxiously complex and hard to read in pracice, thereby nullifying any benefit from the shorthand λ-based notation. This kind of problem with the readability at client-side is quite common when using callbacks for a policy-based design. To overcome this difficutly, it would be necessary to define the policy and the callbacks in one succinct builder expression. Unfortunately such a builder syntax typically requires to write a lot of boilerplate template code. After several failed experiments, I have found a bold new way to exploit features of C++20 in conjunction with a macro, allowing to generate a suitable data record directly form an C++ expression.
11 MiB
11 MiB
| The file is too large to be shown. |