Where does the 'override' qualifier go with trailing return types?

前端 未结 2 1056
一个人的身影
一个人的身影 2021-01-01 10:24

C++11 has the new override qualifier which can be applied to member functions to assert that they override a virtual function in the base class. C++11 also allo

2条回答
  •  猫巷女王i
    2021-01-01 11:15

    According to the standard, 8.4.1, a declarator for a function includes the trailing-return-type, and a class function definition contains "declarator virt-specifier-seqopt". The second one, virt-specifier-seq, is one of final or override, so those come after the trailing return type. (I.e. Clang gets it right.)

提交回复
热议问题