Re:C++26: A Placeholder with No Name
by MathMonkeyMan on Saturday January 11, 2025 @11:29AM
(#42666924)
I write my code with the assumption that the reader does _not_ have access to a "smart" IDE.
I use `auto` when the type is obvious or doesn't really matter, and I seldom create aliases for types.
I feel like having verbose type names at function boundaries and using `auto` for dependent types is the sweet spot. I'll often avoid `auto` when referring to a class data member, so the reader doesn't have to refer to the definition.
Re:C++26: A Placeholder with No Name
by Koshkin on Saturday January 11, 2025 @12:00PM
(#42667167)
Off-topic, but just wanted to note that using floating-point numbers as keys may be generally a bad idea (unless you use a custom comparator that takes into account the error that can accumulate during calculations).
I use `auto` when the type is obvious or doesn't really matter, and I seldom create aliases for types.
I feel like having verbose type names at function boundaries and using `auto` for dependent types is the sweet spot. I'll often avoid `auto` when referring to a class data member, so the reader doesn't have to refer to the definition.
but also `auto` is convenient for iterators. Which of the following is better?