Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > C++ > enum value not in scope inside class?

Reply
Thread Tools

enum value not in scope inside class?

 
 
Joseph Turian
Guest
Posts: n/a
 
      09-27-2006

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

 
Reply With Quote
 
 
 
 
Joseph Turian
Guest
Posts: n/a
 
      09-27-2006
Got it, I just realized I shouldn't have the parenthesized values there
and must initialize the array in the implementation.

Thanks
Joseph

 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
ENUM server for private ENUM kael UK VOIP 2 02-25-2007 11:54 AM
enum: display elements of an enum specified at runtime Jerminia Java 3 10-07-2005 10:08 PM
enum within an enum - Java 6 06-13-2005 12:51 AM
Including an enum within another enum, possible? mrhicks C Programming 2 06-10-2004 03:00 AM
How to enum an enum? Ernst Murnleitner C++ 5 11-13-2003 11:06 AM



Advertisments