C ++ programming error/warning analysis (1) cannot have CV-qualifier

Source: Internet
Author: User

C ++ programming error/warning analysis (1) cannot have CV-qualifier
  • Author: Liu Da-poechant (Zhong Chao)
  • Email: zhongchao. USTC # gmail.com (#-> @)
  • Blog: blog.csdn.net/poechant
  • Date: May 9Th, 2012
Explanation

There cannot be a CV qualifier. In C ++, the CV qualifier refersconstAndvolatile.

  • Non-member functions

In C ++, normal functions (non-class member functions) cannot have CV restrictions, that isconstAndvolatileLimitation. That is, the number of non-class member rows.constModify:

Int test () const // This is incorrect. Normal Functions (non-member functions cannot have CV constraints) {// implement}
  • Static Functions

In C ++, static member functions (staticMember functions) cannot have CV restrictions, that isconstAndvolatileLimitation. That is, the static member functions of the class cannot have CV constraints:

Class test {public: static int test_fun () const; // This is not allowed .}
Reference
  1. Http://blog.163.com/xychenbaihu@yeah/blog/static/132229655201149281131/

-

Liu Da-poechant: blog.csdn.net/poechant

-

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.