View Single Post
  #7   Spotlight this post!  
Unread 20-02-2012, 12:47
rbmj rbmj is offline
Registered User
FRC #0612 (Chantilly Robotics)
Team Role: Alumni
 
Join Date: Apr 2011
Rookie Year: 2011
Location: DC Area/Fairfax County
Posts: 192
rbmj is a jewel in the roughrbmj is a jewel in the roughrbmj is a jewel in the rough
Re: Dividing Speed on Robot Drive

Quote:
Originally Posted by DjScribbles View Post
Yes, that is polymorphism. Basically the function that is used is determined by the parameter types you pass into the function.

Inside the class it defines each different input parameter arrangement with the same function name, and you automatically select between those different functions by the parameters you provide.
It is a form of polymorphism. Function overloading and templates are what is known as static polymorphism. When speaking with most C++ programmers though, polymorphism generally refers to dynamic polymorphism, implemented using function pointers and virtual functions. Static polymorphism is decided at compile time, and is based upon the visible type of the objects to the compiler. Dynamic polymorphism, however, is actually based upon the run-time type of the object.
Reply With Quote