Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
394 views
in Technique[技术] by (71.8m points)

c++ faq - What does "cv-unqualified" mean in C++?

As from subject. I saw this terminology in a question I recently asked, and apparently it's a well established term, but I am not able to find anything on stackoverflow.

See Question&Answers more detail:os

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Answer

0 votes
by (71.8m points)

There are fundamental types and compound types. Fundamental types are the arithmetic types, void, and std::nullptr_t. Compound types are arrays, functions, pointers, references, classes, unions, enumerations, and pointers to non-static members.

A cv-unqualified type is any of those types.

For any cv-unqualified type, there are three corresponding cv-qualified types:

  • const-qualified - with the const cv-qualifier
  • volatile-qualified - with the volatile cv-qualifier
  • const-volatile-qualified - with both the const and volatile cv-qualifiers

Note, however, that cv-qualifiers applied to an array type actually apply to its elements.

The cv-qualified and cv-unqualified types are distinct. That is int is a distinct type from const int.


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...