开发者

Objective-C Block type as return value

开发者 https://www.devze.com 2023-01-20 09:28 出处:网络
How do I write the following: typedef void (^T)(void);开发者_开发技巧 T f() { return ^{}; } without the typedef?void (^f())(void) {

How do I write the following:

typedef void (^T)(void);开发者_开发技巧
T f() {
    return ^{};
}

without the typedef?


void (^f())(void) { 
  return ^{};
}

You'd better keep the typedef as the return type is not easy to understand in this form.

0

精彩评论

暂无评论...
验证码 换一张
取 消