Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
这行代码中的'^'是什么意思,从未见过这样的语法:
int (^gl_errblk)(const char *, int);
它摘自:https ://github.com/Apple-FOSS-Mirror/Libc/blob/master/include/glob.h ,第 68 行。
插入符号^是用于在 clang 块扩展中引入块变量或块表达式的运算符:
^
http://clang.llvm.org/docs/BlockLanguageSpec.html
这是一种定义lambda的方法。基本上它是一个匿名函数,可以作为变量存储和传递。