C++有多少种多态类型?宏多态能不能算作C++中的一种多态类型?
最佳答案
多态性的定义来自Wikipedia :
In programming languages and type theory, polymorphism (from Greek πολύς, polys, "many, much" and μορφή, morphē, "form, shape") is the provision of a single interface to entities of different types.
从这个意义上说,将可以使用 C 预处理器宏创建的通用函数/运算符视为一种多态形式是有意义的。
关于c++ - 关于 C++ 宏多态性,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/25728784/