Why wasn't yield added to C++0x?

后端 未结 8 1656
谎友^
谎友^ 2020-12-13 18:51

I have been using yield in many of my Python programs, and it really clears up the code in many cases. I blogged about it and it is one of my site\'s popular pages.

8条回答
  •  [愿得一人]
    2020-12-13 19:21

    Adding a keyword is always tricky, because it invalidates previously valid code. You try to avoid that in a language with a code base as large as C++.

    The evolution of C++ is a public process. If you feel yield should be in there, formulate an appropriate request to the C++ standard committee.

    You will get your answer, directly from the people who made the decision.

提交回复
热议问题