Passing function parameters by name

Robert Fraser fraserofthenight at gmail.com
Tue Dec 4 11:51:48 PST 2007


bearophile wrote:
> to D/C++ you can find a problem, becasue the "A" and "B" must be associated with the function. And the function must know what parameters aren't actually given to it. So you may need to silently pass an array of booleans too (and uint/ulong suffices) that encode what parameters you have actually given to the function (there are other solutions, based on pointers, but they seem even slower to me).

The call is bound at compile-time, so there's no runtime cost 
associated. The default parameters are passed in explicitly for the 
parameters that the user doesn't supply.



More information about the Digitalmars-d mailing list