17

I have started seeing the term "cv-qualified" being thrown around a lot.

An answer to my last question:

if T is a (possibly cv-qualified) class type (Clause 9), the default constructor (12.1) for T is called

Can someone define that for me?

Community
  • 1
  • 1
Jonathan Mee
  • 37,899
  • 23
  • 129
  • 288

2 Answers2

23

c in cv means const and v means volatile.

From the C++ Standard (3.9.3 CV-qualifiers)

  • The term object type (1.8) includes the cv-qualifiers specified in the decl-specifier-seq (7.1), declarator (Clause 8), type-id (8.1), or newtype - id (5.3.4) when the object is created.

  • A const object is an object of type const T or a non-mutable subobject of such an object.

  • A volatile object is an object of type volatile T, a subobject of such an object, or a mutable subobject of a const volatile object.

  • A const volatile object is an object of type const volatile T, a non-mutable subobject of such an object, a const subobject of a volatile object, or a non-mutable volatile subobject of a const object.

Akshaya
  • 3
  • 1
  • 6
Vlad from Moscow
  • 301,070
  • 26
  • 186
  • 335
22

c-v qualified means const and volatile...For e.g:-

// non cv_qualified 
int first; 
char *second; 

// cv-qualified 
const int third; 
volatile char * fourth; 
ravi
  • 10,994
  • 1
  • 18
  • 36