Need help with C2666 error

B

BCC

Hi,

I have a large mfc project that has been working fine. A while ago, I added
an enum and I want to make a vector of these enums:
class MyClass {
public:
MyClass() {};
~MyClass() {};

enum {
abc = 1,
def = 2,
} ETestType;
};

// In a function later:
std::vector<MyClass::ETestType> types;

So far so good... but then if I try to add anything:
types.push_back(MyClass::abc);

I get the following error:
C:\Program Files\Microsoft Visual Studio .NET\Vc7\include\vector(376): error
C2666: 'std::_Ptrit<enum MyClass::ETestType,int,enum
MyClass::ETestType*,enum MyClass::ETestType&,enum MyClass::ETestType*,enum
MyClass::ETestType&>::eek:perator`+'' : 2 overloads have similar conversions

I created a small test app, and there is no problem with this, so it appears
to be something specific to this app. I do not have any overloaded
operators relating to vector or ETestType -anywhere-.

At my wits end, google didn't pan out, anyone offer any hints or suggestions
on where I should look?

Thanks,
Bryan
 
G

Gianni Mariani

BCC said:
Hi,

I have a large mfc project that has been working fine. A while ago, I added
an enum and I want to make a vector of these enums:
class MyClass {
public:
MyClass() {};
~MyClass() {};

enum {
abc = 1,
def = 2,
} ETestType;
};

don't you mean this ?

enum ETestType {
abc = 1,
def = 2,
};
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,743
Messages
2,569,478
Members
44,898
Latest member
BlairH7607

Latest Threads

Top