On 27.01.2026 18:10, Andrew Cooper wrote: > On 27/01/2026 5:01 pm, Jan Beulich wrote: >> On 27.01.2026 11:18, Andrew Cooper wrote: >>> All of these are simple cases of using typeof() to avoid multiple parameter >>> evaluation. Using auto avoids multiple textural expansion also. >>> >>> No functional change. >>> >>> Signed-off-by: Andrew Cooper <[email protected]> >> Acked-by: Jan Beulich <[email protected]> > > Thanks. > > While I've got people's attentions, there's a secondary pattern we use > that's a bit less clear to convert. > > typeof(a) *_ptr_a = &a; > > With auto, you're required to write this as: > > auto _ptr_a = &a; > > rather than the more-nomal-looking: > > auto *_ptr_a = &a; > > > So far I've only found two examples, and I'm debating leaving them as > are seeing as auto (in this form) is still a new concept to most. > > Thoughts?
If already we're moving to the use of auto, I think such want converting as well. "auto" meaning "type of rhs", this necessarily implies absence of pointer-ness in the type. Really, is "auto *" actually a construct which could make sense in some specific situation? This and the rhs type are (seemingly) guaranteed to conflict. Jan
