"Victor Bazarov" <v.********@comAcast.net> wrote in message
news:xm*****************@newsread1.mlpsca01.us.to. verio.net...
xxx wrote: // cv_qualifier as a specifier when to the left of "x"
int const x = 123;
const int x = 123;
// cv_qualifier as a declarator when to the right of "x"
int x (123) const;
I don't think this is valid.
Do you mean that everything left to the identifier is part of the type
and everything to the right is part of the declarator?
No, I don't mean that. What problem are you trying to solve, anyway?
V
I should have verified it with MS VC++ 7.1. The "int x (123) const" passed
with flying colors with GNU C++ 3.2.3.
Designing a C++ based interpreter is what I'm doing so I would like to make
sure I understand things before I jump right into implementation.
I am trying to understand why cv_qualifier is not a specifier. The previous
syntax may be invalid for declaring constant int, but you could still
declare "void someclass::func (int value) const" where the const in this
case is exactly a declarator because it is part of the member's definition
(as in a member function that doesn't modify any data of the class). I
understand that it is because of this that the cv is a cv_qualifier rather
than a cv_specifier because it can appear in two different context. Ah, I
think I just answered my own question!
Thank you for helping me realize this =)