enum value not in scope inside class?

Discussion in 'C++' started by Joseph Turian, Sep 27, 2006.

  1. I try to compile the following:

    ===
    typedef enum { CREATED, ADDED_TO_AGENDA, POPPED_FROM_AGENDA,
    DUMMY_LAST_CAT } DStatCat;

    class DerivationStatistics {
    ....
    private:
    enum {MAX_LENGTH = 1000};

    typedef boost::multi_array<unsigned, 3> Array;
    static Array(boost::extents[DUMMY_LAST_CAT][MAX_LENGTH][2])
    counts;
    ===

    The last line triggers the following compile error:
    "error: 'DUMMY_LAST_CAT' was not declared in this scope"

    How can I resolve this? Thanks.


    Joseph
     
    Joseph Turian, Sep 27, 2006
    #1
    1. Advertising

  2. Got it, I just realized I shouldn't have the parenthesized values there
    and must initialize the array in the implementation.

    Thanks
    Joseph
     
    Joseph Turian, Sep 27, 2006
    #2
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Paul Opal
    Replies:
    12
    Views:
    976
    Paul Opal
    Oct 11, 2004
  2. Steven T. Hatton
    Replies:
    9
    Views:
    505
  3. puzzlecracker
    Replies:
    10
    Views:
    541
    puzzlecracker
    Apr 16, 2008
  4. Brian
    Replies:
    4
    Views:
    2,699
    Brian
    Feb 27, 2010
  5. Ansel

    "enum" vs. "enum class"

    Ansel, Aug 26, 2012, in forum: C++
    Replies:
    16
    Views:
    768
    Ansel
    Aug 27, 2012
Loading...

Share This Page