Clang的块如何工作? [英] How do Clang 'blocks' work?

查看:117
本文介绍了Clang的块如何工作?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

http://clang.llvm.org/docs/BlockLanguageSpec.txt

看起来很酷。

但是,


  1. 我不明白。

  2. 我没有看到例子。


任何人都可以在这方面启发我?

Can anyone enlighten me on this?

推荐答案

块本质上是一种将代码和范围作为数据传递的方法。它们在某些其他语言中称为关闭和匿名函数。

Blocks are, essentially, a way to pass code and scope around as data. They're known in some other languages as closures and anonymous functions.

这是一个文章,其中包含更多详细信息和代码示例。

Here's an article with more details and code examples.

这篇关于Clang的块如何工作?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆