equivalence between decltype and auto
问题 Since auto and decltype are both used to infer the types. I thought they would be same. However, the answer to this question suggests otherwise. Still I think they cannot be entirely different. I can think of a simple example where the type of i will be same in both the following cases. auto i = 10; and decltype(10) i = 10; So what are the possible situations where auto and decltype would behave equivalently. 回答1: auto behaves exactly the same as template argument deduction, meaning if you