Clang的块如何工作? [英] How do Clang 'blocks' work?
本文介绍了Clang的块如何工作?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
http://clang.llvm.org/docs/BlockLanguageSpec.txt
看起来很酷。
但是,
<
任何人都可以在这方面启发我?
解决方案
块本质上是一种将代码和范围作为数据传递的方法。它们在某些其他语言中称为关闭和匿名函数。
这里是文章,其中包含更多详细信息和代码示例。
http://clang.llvm.org/docs/BlockLanguageSpec.txt
Looks really cool.
However,
- I don't understand it.
- I don't see examples it.
- I don't see examples of ideas hard to express in C++ as is, but trivial to express in blocks.
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屋!
查看全文