How many polymorphism types does C++ have? Can Macro polymorphism be considered as one polymorphism type in C++?
Asked
Active
Viewed 849 times
2
-
3What is _Macro polymorphism_?? This term is new for me. – πάντα ῥεῖ Sep 08 '14 at 16:26
-
1This sounds like a question from a test – TankorSmash Sep 08 '14 at 16:29
-
macro polymorphism is a form of polymorphism in C. Take a look at the last section of this SO answer. http://stackoverflow.com/a/8194632/434551. Not sure whether that is supported in C++03 or C++11. – R Sahu Sep 08 '14 at 16:56
1 Answers
0
The definition of polymorphism from 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.
In that sense, it makes sense to think of generic functions/operators that one can create using C preprocessor macros as a form of polymorphism.

R Sahu
- 204,454
- 14
- 159
- 270