|
-
December 10th, 2008, 09:36 AM
#5
Re: Constant class members in case statements
case label value is required to be not a constant (like, constant variable), but integral constant-expression, and these are, among others, literal values, or constant valiables initialized with literal values. const data member is not integral constant expression, because it might be initialized with non-literal value (i.e. via initialization list in constructor), so it cannot be used in case label.
Cheers
Last edited by Hobson; December 10th, 2008 at 09:41 AM.
B+!
'There is no cat' - A. Einstein
Use [code] [/code] tags!
Did YOU share your photo with us at CG Members photo gallery ?
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|