[Kde-bindings] Parameter decoration

Marcus mathpup at mylinuxisp.com
Sat Jan 11 22:10:17 UTC 2003


On Saturday 11 January 2003 09:30 am, Adam Treat wrote:

> Basically, he wanted to know how we'd handle stuff like:
>
> SomeObject::someMethod(const char * const & someParam)
>
> Besides the fact that it someone should be shot for this, should the DTD
> handle something like this?

I don't even know what something like that means.


> In C# we can declare a param with the 'ref' and 'out' keywords
> (http://msdn.microsoft.com/library/default.asp?url=/library/en-us/csref/htm
>l/vcgrfMethodParameters.asp) so am wondering of a good reason against just
> declaring all references as 'ref'.

As I understand it, adding "ref" or "out" keywords adds a level of indirection 
since you're allowed to change the value of the parameter. If the parameter 
is a System.Int32, for example, the address of a System.Int32 is passed 
instead. The value is true with pointers. When you pass an IntPtr with the 
"ref" or "out" keyword, you're passing a pointer to a pointer. Unnecessary 
use of "ref" or "out" seriously complicates things.




More information about the Kde-bindings mailing list