www.digitalmars.com         C & C++   DMDScript  

D - auto construction syntax

This has been raised several times, but I want to raise it again.

The proposed change is to allow auto objects to have a C++ auto object
syntax, i.e.

    auto class Thing
        this(SomethingElse se);

    int main()
        SomethingElse se = ... ;
        auto Thing thing = new Thing(se); // current syntax
        auto Thing thing(se); // proposed syntax

        . . .

Hopefully the advantages are obvious. It's easier to type, and helps to make
it even clearer that auto objects are *not* on the heap. It doesn't cause
parsing ambiguities (with possible func decls), since it is preceeded with

Votes / thoughts?
Apr 20 2004