Karachi GupShup

Karachi GupShup

Karachi GupShup
 
HomeGame ZoneFAQSearchMemberlistUsergroupsRegisterLog in

Share | 
 

 Static polymorphism

Go down 
AuthorMessage
meodingu
Member
avatar

Male Number of posts : 270
Pointz :
0 / 1000 / 100


PostSubject: Static polymorphism    Tue Jan 11, 2011 4:37 pm

Static polymorphism
Function overloading allows programs to declare multiple functions having the same name (but with different arguments). The functions are distinguished by the number and/or types of their formal parameters. Thus, the same function name can refer to different functions depending on the context in which it is used. The type returned by the function is not used to distinguish overloaded functions.
When declaring a function, a programmer can specify default value for one or more parameters. Doing so allows the parameters with defaults to optionally be omitted when the function is called, in which case the default arguments will be used. When a function is called with fewer arguments than there are declared parameters, explicit arguments are matched to parameters in left-to-right order, with any unmatched parameters at the end of the parameter list being assigned their default arguments. In many cases, specifying default arguments in a single function declaration is preferable to providing overloaded function definitions with different numbers of parameters.
Templates in C++ provide a sophisticated mechanism for writing generic, polymorphic code. In particular, through the Curiously Recurring Template Pattern it's possible to implement a form of static polymorphism that closely mimics the syntax for overriding virtual functions. Since C++ templates are type-aware and Turing-complete they can also be used to let the compiler resolve recursive conditionals and generate substantial programs through template metaprogramming.


Französisch Übersetzungen
online math tutor
Back to top Go down
View user profile
 
Static polymorphism
Back to top 
Page 1 of 1
 Similar topics
-
» Octochess
» STATIC BOOK 3.0 - very strong!
» bila motor static, tarik brek kiri, motor bergegar...

Permissions in this forum:You cannot reply to topics in this forum
Karachi GupShup :: Karachi GupShup Information :: Welcome to Karachi GupShup-
Jump to: