C + + multi-state concept a little messy, there is time on Wikipedia search for the next related terms, summarized as follows:
Polymorphism (computer science)
In programming language and type theory, polymorphism (Greek, meaning many shape) refers to a single interface that corresponds to more than one type of entity. As a polymorphic type, its operation (operation) can also be provided to other types of value. There are several completely different types of polymorphism.
1.Ad hoc polymorphism: Functions can specify different implementations depending on the parameter type (depending on a limited range of individually specified types and combinations.).
is actually a function overload (functions overloading)
2.Parametric polymorphism: The encoding can not specify any particular type, and the type is determined when it is instantiated as a parameter. In object-oriented programming, it is called generic programming, and in functional programming, it is referred to as polymorphism.
In C + + is the template.
3.Subtyping: name specifies instances of different subclasses of a common superclass. In object-oriented programming, it is often referred to as polymorphism.
In C + + it is virtual function (virtual functions).
To summarize, the so-called polymorphic means that an interface (interface) corresponds to different types of entities. Generalized polymorphism, divided into three types, namely ad hoc (the same name function, parameter types), PARAMETIRC (run-time derivation of the actual type), Subtyping (subclass inherits the same name from the superclass interface, implementation of different behaviors), respectively, corresponding to the function in C + + Overloading, Template, and virtual function. In C + +, the so-called polymorphic, corresponding to the subtyping, through the virtual function of the way to achieve.
Reference Links:
1. Https://en.wikipedia.org/wiki/Polymorphism_ (computer_science)
2. Https://en.wikipedia.org/wiki/Ad_hoc_polymorphism
3. Https://en.wikipedia.org/wiki/Parametric_polymorphism
4. https://en.wikipedia.org/wiki/Subtyping
Polymorphic (polymorphism)