April 17, 2005 Re: Accessing class members | ||||
---|---|---|---|---|
| ||||
Posted in reply to Derek Parnell | On Sun, 17 Apr 2005 16:19:34 +1000, Derek Parnell <derek@psych.ward> wrote:
> On Sun, 17 Apr 2005 18:03:03 +1200, Regan Heath wrote:
>
>
> [snip]
>>
>>>> So, in essence you must 'new' all class instances, always.
>>>
>>> Well, only if you want them to point to an instance. ;-)
>>
>> I think you're confusing instance and reference.
>>
>> Foo f; //class reference
>> new Foo() //class instance
>>
>> 'new' is required to create an instance.
>
> Thank you, but I wasn't confusing the two. What I was doing was misreading
> your phrase "in essence you must 'new' all class instances, always" as "one
> must always use 'new' if you declare a class variable". Thus my response
> could be expanded to "Well, only if you want the class variable to
> reference an actual class instance". It was my mistake.
NP. Just checking.
Regan
|
April 17, 2005 Re: Accessing class members | ||||
---|---|---|---|---|
| ||||
Posted in reply to Derek Parnell | In article <cuqq7j7zgh64.1ijtneglw90t5.dlg@40tude.net>, Derek Parnell says... >The OP didn't mention anything about creating objects on the stack. Maybe we need to explain what is apparently obvious to some but not to others. Thanks heaps, that helped a lot. OP |
Copyright © 1999-2021 by the D Language Foundation