enum value not in scope inside class?

J

Joseph Turian

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
 
J

Joseph Turian

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

Thanks
Joseph
 

Ask a Question

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

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,763
Messages
2,569,562
Members
45,039
Latest member
CasimiraVa

Latest Threads

Top