C++ iterators considered harmful?

后端 未结 13 669
忘了有多久
忘了有多久 2020-12-23 03:42

At the Boost library conference today, Andrei Alexandrescu, author of the book Modern C++ Design and the Loki C++ library, gave a talk titled \"Iterators Must Go\" (video, s

13条回答
  •  暗喜
    暗喜 (楼主)
    2020-12-23 03:45

    1. Most of us make a simple use of them in what have become well known idioms, like in for loops to iterate through an std::vector. A developer reads it and knows what's going on. In our everyday coding life, iterators are not good or bad, they're just "what gets the job done".
    2. Probably, yes.
    3. I don't think so.

提交回复
热议问题