Re:21st Century C++ (Feb. 2025) by Bjarne Stroustrup
by musicale on Saturday February 08, 2025 @07:25PM
(#42987403)
I just wish they hadn't repurposed the old "auto" keyword from C and had used a new keyword like "var" or "let".
[ Parent
| on HN ]
Re:21st Century C++ (Feb. 2025) by Bjarne Stroustrup
by galkk on Saturday February 08, 2025 @08:13PM
(#42987616)
If we're going that route, how about
#define var auto
#define let const auto
?
Re:21st Century C++ (Feb. 2025) by Bjarne Stroustrup
by musicale on Sunday February 09, 2025 @10:21PM
(#42996581)
I was thinking of having one or the other, but let as the const form is appealing. ;-)
Re:21st Century C++ (Feb. 2025) by Bjarne Stroustrup
by maleldil on Saturday February 08, 2025 @08:35PM
(#42987740)
Given how important backwards compatibility is for C++, it's either take over a basically unused keyword or come up with something so weird that would never appear in existing code.
Java solved this by making var a reserved type, not a keyword, but I don't know if that's feasible for C++.