News for hackers. Stuff that matters.
Re:Gosh Darn Function Pointers by inopinatus on Monday January 15, 2018 @05:34PM (#16154063)
It allows the later definition of func * f which is more readable and maintainable than int (* f)(int arg)

This pattern is common in well-structured applications, and is especially useful for clarifying external and internal APIs. e.g. from the Dovecot IMAP server:

    typedef bool event_callback_t(struct event *event,
    			      enum event_callback_type type,
    			      struct failure_context *ctx,
    			      const char *fmt, va_list args);
You can now define a function pointer or declare a parameter using event_callback_t. This is both concise and intention revealing.

There are no comments on this comment yet.