Thread overview
[Issue 11615] Syntax to indicate auto return type is const
Apr 19, 2014
Andrej Mitrovic
Feb 20, 2020
Basile-z
Mar 21, 2020
Basile-z
April 19, 2014
https://issues.dlang.org/show_bug.cgi?id=11615

Andrej Mitrovic <andrej.mitrovich@gmail.com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |andrej.mitrovich@gmail.com,
                   |                            |k.hara.pg@gmail.com

--- Comment #1 from Andrej Mitrovic <andrej.mitrovich@gmail.com> ---
Hmm.. interesting problem. Kenji what are your thoughts?

--
February 20, 2020
https://issues.dlang.org/show_bug.cgi?id=11615

Basile-z <b2.temp@gmx.com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|NEW                         |RESOLVED
                 CC|                            |b2.temp@gmx.com
         Resolution|---                         |WORKSFORME

--- Comment #2 from Basile-z <b2.temp@gmx.com> ---
I think this ER is nowadays invalid. You can use the `const` STC alone, which is like the `const auto` you wanted.

struct Foo
{
    int[] _arr = [0, 1, 2, 3, 4];

    const arr() @property
    {
        return _arr;
    }

    pragma(msg, typeof(arr())); // const(int[])
}

--
March 21, 2020
https://issues.dlang.org/show_bug.cgi?id=11615

Basile-z <b2.temp@gmx.com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|b2.temp@gmx.com             |

--