The Yaoi Universe
Would you like to react to this message? Create an account in a few clicks or log in to continue.

The Yaoi Universe

this is boy+boy love and everything that goes with it. Must be 16+ to join
 
HomeLatest imagesSearchRegisterLog in

 

 Static polymorphism

Go down 
AuthorMessage
meodingu

meodingu


Posts : 156
Join date : 2010-09-21

Static polymorphism  Empty
PostSubject: Static polymorphism    Static polymorphism  Icon_minitimeTue Jan 11, 2011 10:08 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.


China surveillance supplier
Home improvement
Back to top Go down
 
Static polymorphism
Back to top 
Page 1 of 1
 Similar topics
-
»  Polymorphism

Permissions in this forum:You cannot reply to topics in this forum
The Yaoi Universe :: General Chill Out :: Disscussion-
Jump to: