What is the point of the 'auto' keyword?

后端 未结 8 914
暗喜
暗喜 2020-12-16 03:30

So I understand using var in C# makes sense because you have anonymous types that are compiler derived. C++ doesn\'t seem to have this feature (unless I\'m wron

8条回答
  •  醉话见心
    2020-12-16 03:54

    syntactic sugar

    I rather say

    auto i = mapping.begin();
    

    over

    std::map::iterator i = mapping.begin();
    

提交回复
热议问题