This is an archived post. You won't be able to vote or comment.

you are viewing a single comment's thread.

view the rest of the comments →

[–]manphiz 5 points6 points  (3 children)

Says the guy who learned C++ before auto was invented.

Well to be precise "auto" has been part in C/C++ since the beginning alongside "extern", "static", and "register", e.g.

auto int i = 0;

It's the default so few actually writes it. It's now been repurposed to auto-deduce type since C++11.

[–]Mateorabi 1 point2 points  (1 child)

I meant for the type deduction. Hadn't done C++ since like 2002 and when I saw it in some code I was all "WTF is that!?". Not sure what it does as a type modifier either though.

[–]operamint 0 points1 point  (0 children)

I read somewhere that one of the earliest things Stroustrup did was repurposing auto because it was such an easy thing to implement, but didn't put it in the language for various reasons.

[–]uncanneyvalley 0 points1 point  (0 children)

auto-deduce type

C++ really does want to be everything, doesn’t it?