关于  typeof()和 __typeof()  和 __typeof__() ,Stack Overflow 有一段解释,大概意思是,

__typeof() 、__typeof__() 是C语言的编译器特定扩展,因为标准C语言是不含这样的运算符的。标准C要求编译器用双下划线前缀扩展语言。(这也是为什么你不应该为自己的函数,变量加双下划线的原因);

typeof() 运算符也是完全相同。这三个运算符都一样,就是在编译时检查类型的。

还有一点需要注意:

-isKindOfClass: 函数是一个函数,它是在运行时检查一个对象是属于哪一个类的。而typeof()家族是一个编译期类型检查运算符,它不只能检查类,也能检查所有有效的C语言表达式;

-isKindOfClass: is a runtime check on the class of an object. The typeof() family is a compile-time check on the type (not just class) of any valid C expression.

__typeof__() and __typeof() are compiler-specific extensions to the C language, because standard C does not include such an operator. Standard C requires compilers to prefix language extensions with a double-underscore (which is also why you should never do so for your own functions, variables, etc.)

typeof() is exactly the same, but throws the underscores out the window with the understanding that every modern compiler supports it. (Actually, now that I think about it, Visual C++ might not. It does support decltype() though, which generally provides the same behaviour as typeof().)

All three mean the same thing, but none are standard C so a conforming compiler may choose to make any mean something different.

typeof(), __typeof(), __typeof__(), -isKindOfClass:的区别的更多相关文章

  1. JavaScript中instanceof与typeof运算符的用法及区别详细解析

    JavaScript中的instanceof和typeof常被用来判断一个变量是什么类型的(实例),但它们的使用还是有区别的: typeof 运算符 返回一个用来表示表达式的数据类型的字符串. typ ...

  2. typeof()和instanceof的用法区别

    typeof() typeof() 是一个一元运算,放在一个运算数之前,运算数可以是任意类型.它返回值是一个字符串,该字符串说明运算数的类型.,typeof一般只能返回如下几个结果:number,bo ...

  3. isMemberOfClass和isKindOfClass的区别

    1.isMemberOfClass:作用:用于判断一个对象是否属于当前这个类   Person *rose = [[Person alloc] init];          if ([rose is ...

  4. c# typeof 与 GetType 作用与区别

    官方解释: Used to obtain the "System.Type" object for a type. A 'typeof' expression takes the ...

  5. [C#]typeof,Gettype()和is的区别

    typeof 参数是一个类型名称,比如你自己编写的一个类 GetType()是类的方法,继承自object,返回该实例的类型 is 用来检测实例的兼容性(是否可以相互转换) 例: class Anim ...

  6. typeof 与 instanceof之间的区别

    JS中会使用typeof 和 instanceof来判断一个变量是否为空或者是什么类型的. ES6规范中有7种数据类型,分别是基本类型和引用类型两大类 基本类型(简单类型.原始类型):String.N ...

  7. JavaScript中typeof和instanceof深入详解

    这次主要说说javascript的类型判断函数typeof和判断构造函数原型instanceof的用法和注意的地方. typeof 先来说说typeof吧.首先需要注意的是,typeof方法返回一个字 ...

  8. 如何判断js中的数据类型?

    js六大数据类型:number.string.object.Boolean.null.undefined string: 由单引号或双引号来说明,如"string" number: ...

  9. js数据类型判断和数组判断

    这么基础的东西实在不应该再记录了,不过嘛,温故知新~就先从数据类型开始吧 js六大数据类型:number.string.object.Boolean.null.undefined string: 由单 ...

随机推荐

  1. javascript promises powered by BlueBird

    什么是promises? 为什么需要promises? 参见: https://promisesaplus.com/ 使用示例: 使用promises之前,代码的编写方式: 使用promises之后: ...

  2. linux 下的emoji在MariaDB中的字符集修改

    在此目录下修改这个文件: 添加一行字符集: 然后重启服务,就OK了

  3. [svc]linux的ip命令操作接口和路由表

    参考: https://www.tecmint.com/ip-command-examples/ 学会linux的配置ip,配置网关,添加路由等命令 man ip man ip address man ...

  4. oracle 11g rac asm磁盘组增加硬盘

    要增加磁盘的磁盘组为:DATA 要增加的磁盘为: /dev/sde1 在第一个节点上:[root@rac1 ~]# fdisk /dev/sdeDevice contains neither a va ...

  5. 15款css3鼠标悬停图片动画过渡特效

    分享15款css3鼠标悬停图片动画过渡特效.这是一款15款不同效果的css3 hover动画过渡效果代码.效果图如下: 在线预览   源码下载 实现的代码. html代码: <div class ...

  6. git-ftp代码部署方式

    虽然如今ci方法已经在很多团队使用了,但对于一些个人性的基于PHP的跑在虚拟主机的小项目,既没有服务端的Git环境,又不想时刻跑一个Genkins,就只能回到原始的FTP上传了. 所幸有了git-ft ...

  7. JVM:基础

    参考 温绍景-Java虚拟机基础

  8. altium designer 10如何画4层板

    本篇博客主要讲解一下如何用altium designer10去画4层板. 想想当初自己画4层板时,也去网上海找资料,结果是零零散散,也没讲出个123,于是硬着头皮去找师兄,如何画4层板.师兄冷笑道:“ ...

  9. Java8学习笔记(七)--Collectors

    本系列文章翻译自@shekhargulati的java8-the-missing-tutorial 你已经学习了Stream API能够让你以声明式的方式帮助你处理集合.我们看到collect是一个将 ...

  10. oracle 数据库对于多列求最大值

    1.案例: SELECT GREATEST('36', '55', '34') V_MAX, LEAST('36', '55', '34') V_MIN FROM DUAL Oracle比较一列的最大 ...