[prev in list] [next in list] [prev in thread] [next in thread] 

List:       kde-bindings
Subject:    Re: [Kde-bindings] Parameter decoration
From:       Marcus <mathpup () mylinuxisp ! com>
Date:       2003-01-11 22:10:17
[Download RAW message or body]

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.

_______________________________________________
Kde-bindings mailing list
Kde-bindings@mail.kde.org
http://mail.kde.org/mailman/listinfo/kde-bindings
[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic