auto: useful, annoying or bad practice?
Atila Neves
atila.neves at gmail.com
Sat May 5 13:16:13 UTC 2018
On Monday, 30 April 2018 at 21:31:48 UTC, Giles Bathgate wrote:
> On Monday, 30 April 2018 at 21:11:07 UTC, Gerald wrote:
>>[...]
>
> It takes some getting used to. Type inference is useful because
> often you don't care/know, or want to type out the full name of
> the type for every variable. It does, however, assume that the
> developer can also do type inference (when/if you need to know
> the type). When it's not clear what the type is by looking at
> the right-hand side perhaps the codebase has bigger problems.
>
> functions that return auto are a bit odd IMHO, that is a
> feature unique to D.
C++14 would beg to differ. As would any language with
Hindley-Milner type inference.
Atila
More information about the Digitalmars-d
mailing list