-
Notifications
You must be signed in to change notification settings - Fork 47
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
C++ functor or function pointer? #55
Comments
I think it's a "moreover, functors are not C++ compatible" kind of sentence, as in adding extra info rather than deducing info from the previous sentence. I'd personally thus rephrase it as such, with even an added "e.g., lambdas" attached to the "functors" mention:
|
Thanks for the explanation. |
Yeah, the terms in this area are both quite overloaded for some, and quite diverse for others. A C++ functor seems to be what other languages call a callable, i.e., anything with an
Then we have Moreover, we have a way to express, within a single expression, the definition of an anonymous callable / We also have functions, as in free functions (or methods), which thus are not allowed to refer to captured state: all its state is given through its arguments (although in the case of C++, methods have the implicit And finally, we have function pointers, which would be the |
"When binding with C or even C++, one cannot guarantee easily the validity of the function pointer. C++ functors are not C-compatible".
https://github.com/ANSSI-FR/rust-guide/blob/master/src/en/07_ffi.md?plain=1#L455
The text was updated successfully, but these errors were encountered: