Is D 0.163 D 1.0?
Andrei Khropov
andkhropov at nospam_mtu-net.ru
Mon Jul 24 17:23:01 PDT 2006
Regan Heath wrote:
> I'd prefer scoped destruction to simply omit the 'new' keyword, eg.
>
> class A {}
>
> A a = new A(); //normal
> A a = A(); //destroyed at end of scope
>
> and with auto..
>
> auto a = new A(); //normal
> auto a = A(); //destroyed at end of scope
>
> Simple, elegant, obvious (IMO)
>
> Regan
Well, it may be a solution, but I personally regard 'new' as a visual cue that
indicates that memory is allocated from the heap.
But considering your proposal we should get rid of 'auto class' too,
because 'auto' should mean only one thing - be it scope lived classes or type
inference.
I think it's easier to change type inference syntax since it's a relatively
recent addition and hence it'll break less code.
--
AKhropov
More information about the Digitalmars-d
mailing list