Thread overview | |||||||
---|---|---|---|---|---|---|---|
|
April 02, 2004 auto Suggestion | ||||
---|---|---|---|---|
| ||||
Shouldn't variables be "auto" automatically? I was surprised to read that they werent. Phill. --- Outgoing mail is certified Virus Free. Checked by AVG anti-virus system (http://www.grisoft.com). Version: 6.0.644 / Virus Database: 412 - Release Date: 3/26/2004 |
April 05, 2004 Re: auto Suggestion | ||||
---|---|---|---|---|
| ||||
Posted in reply to Phill | I think the basic types are auto'ed , and structs are automatically auto, but classes require the keyword. Its kinda hard coming from C++ to get over having to 'new' something thats on the stack , but it does drive home the point that everything must be new'ed :). C On Sat, 3 Apr 2004 07:55:59 +1000, Phill <phill@pacific.net.au> wrote: > Shouldn't variables be "auto" automatically? > > I was surprised to read that they werent. > > Phill. > > > > --- > Outgoing mail is certified Virus Free. > Checked by AVG anti-virus system (http://www.grisoft.com). > Version: 6.0.644 / Virus Database: 412 - Release Date: 3/26/2004 > > -- D Newsgroup. |
April 05, 2004 Re: auto Suggestion | ||||
---|---|---|---|---|
| ||||
Posted in reply to C | C wrote: > I think the basic types are auto'ed , and structs are automatically auto, but classes require the keyword. Its kinda hard coming from C++ to get over having to 'new' something thats on the stack , but it does drive home the point that everything must be new'ed :). > > C I just remember that classes in D are actually pointers to objects, not objects themselves. Therefore classes need to be autoed if you want them handled by the stack. Everything else (for this particular topic) works the same as in C++. -- -Anderson: http://badmama.com.au/~anderson/ |
April 06, 2004 Re: auto Suggestion | ||||
---|---|---|---|---|
| ||||
Posted in reply to C | "C" <dont@respond.com> wrote in message news:opr5z5iqrdehmtou@localhost... I think the basic types are auto'ed , and structs are automatically auto, but classes require the keyword. Its kinda hard coming from C++ to get over having to 'new' something thats on the stack , but it does drive home the point that everything must be new'ed :). Especially women! Phill C On Sat, 3 Apr 2004 07:55:59 +1000, Phill <phill@pacific.net.au> wrote: > Shouldn't variables be "auto" automatically? > > I was surprised to read that they werent. > > Phill. > > > > --- > Outgoing mail is certified Virus Free. > Checked by AVG anti-virus system (http://www.grisoft.com). > Version: 6.0.644 / Virus Database: 412 - Release Date: 3/26/2004 > > -- D Newsgroup. --- Outgoing mail is certified Virus Free. Checked by AVG anti-virus system (http://www.grisoft.com). Version: 6.0.648 / Virus Database: 415 - Release Date: 3/31/2004 |
April 27, 2004 Re: auto Suggestion | ||||
---|---|---|---|---|
| ||||
Posted in reply to C | In article <opr5z5iqrdehmtou@localhost>, C says...
>
>I think the basic types are auto'ed , and structs are automatically auto= , =
>
>but classes require the keyword. Its kinda hard coming from C++ to get =
>
>over having to 'new' something thats on the stack , but it does drive ho=
Auto objects are not on the stack. They are on the heap, but their destructor is called when when the pointer goes out of scope. It is there in order to implement RAII.
|
Copyright © 1999-2021 by the D Language Foundation