On Monday, 30 April 2018 at 21:11:07 UTC, Gerald wrote:
So I'm curious, what's the consensus on auto?

In the example below, what would I use, besides auto?

------------------------
module test;

void main ()
{
    import std.stdio : writeln;
    auto result = newKing("King Joffrey");
    writeln(result.getName);
}

auto newKing(string name)
{
    class King
    {
        private string _name;
public string getName() { return this._name ~ " : the one true king!"; }
        this() { this._name = name; }
    }

    return new King;
}

------------------------------

Reply via email to