Connecting Tech Pros Worldwide Help | Site Map

enum value not in scope inside class?

Joseph Turian
Guest
 
Posts: n/a
#1: Sep 27 '06

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, 3Array;
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
Guest
 
Posts: n/a
#2: Sep 27 '06

re: enum value not in scope inside class?


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

Thanks
Joseph

Closed Thread