Liste des Groupes | Revenir à cl c |
On Fri, 13 Sep 2024 14:12:32 +0200No, because this is a parameter and a lambda is a glue of an
Bonita Montero <Bonita.Montero@gmail.com> wrote:
Am 13.09.2024 um 10:38 schrieb Michael S:So, do you admit that callback in C can have state?On Fri, 13 Sep 2024 07:28:34 +0200>
Bonita Montero <Bonita.Montero@gmail.com> wrote:
Am 12.09.2024 um 21:38 schrieb Michael S:>
Callback is as easy in C as in C++.>
Absolutely not because callbacks can't have state in C.
>
So what is 'context' parameter in my code?
In C++ the state is an own internal "this"-like object and you dont't
need any explicit parameters.
Bad software engineering practice that easily leads to incomprehensibleI'm using this convention with nearly any lambda and if I can't
code.
When in C++ and not in mood for C-style, I very much prefer functors.No, A C++ functor may be an object with a calling operator. In C you
Ideologically they are the same as C-style context, but a little
sugarized syntactically.
Les messages affichés proviennent d'usenet.