(v) is actually (*&v) since when?

前端 未结 3 1956
臣服心动
臣服心动 2021-02-13 00:32

Could C++ standards gurus please enlighten me:

Since which C++ standard version has this statement failed because (v) seems to be equivalent to (*&

3条回答
  •  刺人心
    刺人心 (楼主)
    2021-02-13 00:57

    If you look at the revision summary of the latest C++1z draft, you'd see this in [diff.cpp14.dcl.dcl]

    [dcl.stc]
    Change: Removal of register storage-class-specifier.
    Rationale: Enable repurposing of deprecated keyword in future revisions of this International Standard.
    Effect on original feature: A valid C++ 2014 declaration utilizing the register storage-class-specifier is ill-formed in this International Standard. The specifier can simply be removed to retain the original meaning.

    The warning may be due to that.

提交回复
热议问题