Problem using enum with vector?
From: BCC (a_at_b.c)
Date: 10/31/03
- Next message: Dhruv: "Re: looking for compilers and/or platforms **without** C++ exception support"
- Previous message: Peter Ammon: "Re: random_shuffle seed"
- Next in thread: Josephine Schafer: "Re: Problem using enum with vector?"
- Reply: Josephine Schafer: "Re: Problem using enum with vector?"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Date: Fri, 31 Oct 2003 02:43:38 GMT
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?
- Next message: Dhruv: "Re: looking for compilers and/or platforms **without** C++ exception support"
- Previous message: Peter Ammon: "Re: random_shuffle seed"
- Next in thread: Josephine Schafer: "Re: Problem using enum with vector?"
- Reply: Josephine Schafer: "Re: Problem using enum with vector?"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Relevant Pages
|