C ++プログラミングエラー/警告分析(1)にcv-qualifierを含めることはできません



C Programming Error Warning Analysis Cannot Have Cv Qualifier



  • 著者:LiuDa・Poechant(Zhong Chao)
  • メール:zhongchao.ustc#gmail.com(#-> @)
  • ブログ: Blog.CSDN.net/Poechant
  • 日付:5月9日th、2012

説明

C ++ const with volatileにCV修飾子、CV修飾子を含めることはできません。

  • 非会員機能

C ++では、通常の関数(非クラスメンバー関数)にCV制限を設定することはできません。つまり、const with volatile limitedです。つまり、非クラスメンバー行の数const変更を加えます:



Int test() const //This is wrong, normal functions (non-member functions cannot have CV constraints) { //implement }
  • 静的関数

C ++では、静的メンバー関数(staticメンバー関数)にCV制限を設定することはできません。つまり、const with volatile limitedです。つまり、クラスの静的メンバー関数にCV制約を設定することはできません。

class Test { public: Static int test_fun() const //This is not allowed. }

参照

  1. http://blog.163.com/root@xxxxx/blog/static/132229655201149281131/

-



Liu Da Poechant: Blog.CSDN.net/Poechant

-