C++ iterators considered harmful?

后端 未结 13 557
忘了有多久
忘了有多久 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 04:08

    I agree with him that iterators are mostly inferior to ranges, and I don't know if 'something better' will get picked up.

    "The good is the enemy of the best" is strongly at play here, as it usually is. Iterators are useful and firmly entrenched, so it's hard to know if something better like ranges can supplant them in a reasonable amount of time.

提交回复
热议问题