B
BCC
I have a simple container class with an enum:
class MyObject {
typedef enum {
etype1,
etype2
} EType;
};
In another class I have a vector:
std::vector<MyObject::EType> type_vec;
Compiling works okay up to this point, but I need a vector of my enum types.
If I try to add one:
type_vec.push_back(MyObject::etype1);
I get a compiler error C2666 "etc etc" 2 overloads have similar conversions.
I use this enum in many places without a problem, just creating and using a
vector of them seems to be a problem.
What am I doing wrong?
class MyObject {
typedef enum {
etype1,
etype2
} EType;
};
In another class I have a vector:
std::vector<MyObject::EType> type_vec;
Compiling works okay up to this point, but I need a vector of my enum types.
If I try to add one:
type_vec.push_back(MyObject::etype1);
I get a compiler error C2666 "etc etc" 2 overloads have similar conversions.
I use this enum in many places without a problem, just creating and using a
vector of them seems to be a problem.
What am I doing wrong?