News for hackers. Stuff that matters.
Re:Formatting Text in C++: The Old and the New Ways by nuancebydefault on Saturday September 16, 2023 @05:34PM (#37538931)
That's why some newer languages have 'const are the default'.
Re:Formatting Text in C++: The Old and the New Ways by Tommstein on Saturday September 16, 2023 @05:40PM (#37538980)
I'm pretty sure it's the reference that makes the data not be copied.
Re:Formatting Text in C++: The Old and the New Ways by nuancebydefault on Saturday September 16, 2023 @06:12PM (#37539291)
Copying the data to a const makes little sense in this case. The extra & choice that has emerged makes things more complicated than needed. The sad faith of this old language.
Re:Formatting Text in C++: The Old and the New Ways by nly on Saturday September 16, 2023 @06:49PM (#37539584)
Without the const the key would still be const.