在stackoverflow上看到 一个话题 (点击打开链接)
In objective-c I often use __typeof__(obj) when dealing with blocks etc. Why not __typeof(obj)or typeof(obj). I guess typeof(obj) is used for primitives and stuff like that.
When to use which?
自己对回答内容的理解,
以上三种样式的typeof只是针对不同的 c语言编译版本 有所不同, 而在gun99和c99及以后的版本中三者通用。
具体的解决方案见上面链接
本文探讨了Objective-C中__typeof__, __typeof和typeof的区别及其使用场景。这三种形式主要适用于不同版本的C语言编译器,在GNU C99及之后的版本中,它们可以互换使用。
1万+

被折叠的 条评论
为什么被折叠?



