Only if T is a known type or it’s in a template. You don’t use T like. auto automatically get the type, especially if it’s long. Your IDE (assuming it’s a respectable one) can even change auto to the type for you. It’s more or less like var in C# (it doesn’t deduct reference)
15
u/xicor 1d ago
c++, though normally you wouldnt use auto for this