Why is the restrict keyword not part of C++?

前端 未结 2 1640
小蘑菇
小蘑菇 2021-01-01 10:35

The title says it all. I am curious why is the restrict keyword not part of C++ ? I don\'t know much about C++, and I\'m still not able to find anything online that would gi

2条回答
  •  轮回少年
    2021-01-01 11:13

    Not to detract from osgx's answer, but - there is a somewhat more up-to-date paper, N3998 by Finkel, Tong, Carrouth, Nelson Vandevoode and Wong, from May 2014:

    Towards restrict-like aliasing semantics for C++

    And an ever newer one from 2018:

    [[assert: std::disjoint(A,nA, B,nB)]]: Contract assertions as an alternate spelling of ‘restrict’

    (Thanks @MCCCS for pointing the last one out.)

提交回复
热议问题