I have come across the type "cv void" in the latest draft of the C++ standard (N4606) :
8.3.3 [dcl.mptr], paragraph 3
A pointer to member shall not point to a static member of a class (9.2.3), a member with reference type, or “cv void”.
With a little bit of research, I found "cv void" is a real type, but I have no idea what's the difference compared to the type void. Can you explain it with an example (maybe with a code) ?
EDIT :
3.9.1 [basic.fundamental], paragraph 9
A type cv void is an incomplete type that cannot be completed; such a type has an empty set of values...
"cv void" is not a real type. "cv" here is a shorthand for "possibly cv-qualified", which means "may have a const
or a volatile
on it".
The passage means that a pointer-to-member may not point to an object of the following types: void
, const void
, volatile void
and const volatile void
. It's fairly obvious, since such objects cannot exist in the first place, but I guess it's nice to be clear.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With