Typedeffing a function (NOT a function pointer)

前端 未结 6 2250
醉酒成梦
醉酒成梦 2020-12-17 05:20
typedef void int_void(int);

int_void is a function taking an integer and returning nothing.

My question is: can it be

6条回答
  •  猫巷女王i
    2020-12-17 05:39

    It can be used in the following cases (out of the top of my head):

    • generic code:

      boost::function func;

    • other typedefs:

      typedef int_void* int_void_ptr;

    • declarations:

      void add_callback(int_void* callback);

    There may be others.

提交回复
热议问题