2
2b|!2b==?
I am getting strange compiler behaviour (compiler crashes) when building
some code. here is a snippet ..:
I have the ff class and type defs:
class A
{
public:
struct Type
{
enum Enum
{
FirstItem = -1 ,
Barney1 ,
Barney2 ,
Barney3 ,
LastItem
};
};
typedef Type::Enum ModelType ;
typedef std::vector<ModelType> ModelTypes ;
struct Result
{
enum Enum
{
FirstItem = 0,
Fred1 ,
Fred2 ,
LastItem
};
};
typedef Result::Enum ResultType ;
.....
};
The line that causes the compielr to crash looks like this:
int temp = somefunc();
if ( temp <= A::ResultType::FirstItem || temp >=
A::ResultType::LastItem )
{
.... //do domething
}
Is there something patently wrong about this. I know I am being cheeky
using the 'tags' First/LastItem in the enumerations, but I thought they
had different scopes ?
some code. here is a snippet ..:
I have the ff class and type defs:
class A
{
public:
struct Type
{
enum Enum
{
FirstItem = -1 ,
Barney1 ,
Barney2 ,
Barney3 ,
LastItem
};
};
typedef Type::Enum ModelType ;
typedef std::vector<ModelType> ModelTypes ;
struct Result
{
enum Enum
{
FirstItem = 0,
Fred1 ,
Fred2 ,
LastItem
};
};
typedef Result::Enum ResultType ;
.....
};
The line that causes the compielr to crash looks like this:
int temp = somefunc();
if ( temp <= A::ResultType::FirstItem || temp >=
A::ResultType::LastItem )
{
.... //do domething
}
Is there something patently wrong about this. I know I am being cheeky
using the 'tags' First/LastItem in the enumerations, but I thought they
had different scopes ?