Re: Why properties cannot be used as ref or out arguments

Ryan Heath <[email protected]> Mon, 10 Mar 2008 10:28:04 +0100
Newsgroups gmane.comp.windows.devel.dotnet.clr
Message-ID <[email protected]>
Because properties are implemented underneath as functions.
get_PropName
set_PropName

A ref argument cannot point to a func, and if it did, it would point
to the wrong function in any case.

ref arg needs the passing value; it would need the get_PropName function for it.
but ref arg needs to set the value as well; it would need the
set_PropName function for it.

HTH
// Ryan

On Mon, Mar 10, 2008 at 10:20 AM, Dean Cleaver
<[email protected]> wrote:
> I can understand ref arguments, because they might not be set on
> passing, but I can't figure out why they can't be used as out arguments?
>
> Any thoughts?
>
> Dino
>
> ===================================
> This list is hosted by DevelopMentor(R)  http://www.develop.com
>
> View archives and manage your subscription(s) at http://discuss.develop.com
>

===================================
This list is hosted by DevelopMentorĀ®  http://www.develop.com

View archives and manage your subscription(s) at http://discuss.develop.com