Hi all
I have code that looks like this:
//// MyThing.h
#include <string>
using std::string;
class MyThing
{
public:
enum Value
{
FIRST,
SECOND,
THIRD,
COUNT
}
static Value lookup(string &stringFromFile );
private:
...
};
////
In another file I have:
//// UsingMyThing.cc
#include "MyThing.h"
void Foo(MyThing::Va lue bar)
{
switch(bar)
{
case FIRST:
// do something neat
break;
case SECOND:
// do something neat
break;
case THIRD:
//die
default:
break;
}
}
////
My problem is that for some reason, my compiler's telling me that it's never seen FIRST, SECOND, or THIRD. What is the reason for this? Would I get an error like this if I exposed a similar enum with values of the same name?...
-koregu
I have code that looks like this:
//// MyThing.h
#include <string>
using std::string;
class MyThing
{
public:
enum Value
{
FIRST,
SECOND,
THIRD,
COUNT
}
static Value lookup(string &stringFromFile );
private:
...
};
////
In another file I have:
//// UsingMyThing.cc
#include "MyThing.h"
void Foo(MyThing::Va lue bar)
{
switch(bar)
{
case FIRST:
// do something neat
break;
case SECOND:
// do something neat
break;
case THIRD:
//die
default:
break;
}
}
////
My problem is that for some reason, my compiler's telling me that it's never seen FIRST, SECOND, or THIRD. What is the reason for this? Would I get an error like this if I exposed a similar enum with values of the same name?...
-koregu
Comment