C++ auto isn't type inference, as so often in C++ it's something weirder which they call type deduction.
In languages with type inference when it could be A or B and it's left to infer the type the compiler just always says it could be A or B, so the programmer needs to disambiguate.
But with deduction in some cases C++ will deduce that you meant A even though you could instead have explicitly chosen B here instead, and too bad if you did mean B because that's not what it deduced.
Can you show me some examples where the deduction is not the expected type?
Here's an easy to understand example
https://cpp.godbolt.org/z/hTaPbM3a4