CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 7 of 7

Threaded View

  1. #5
    Join Date
    Dec 2004
    Location
    Poland
    Posts
    1,165

    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
  •  





Click Here to Expand Forum to Full Width

Featured