error 2666?

B

BCC

Hi,

I have some very simple code:

class CTest
{
public:
CTest(void) {};
~CTest(void) {};
};

// In another part of the code
std::vector<CTest> test_vec;
CTest ct;
test_vec.push_back(ct);


Doesn't seem like anything unusual to me, but VC++ .NET gives me a 2666
error, saying:
std::ptrit<//etc, etc>::eek:perator + : 2 overloads have similar conversions

Am I missing the obvious or is there something else going on?

Thanks,
B
 
V

Victor Bazarov

BCC said:
I have some very simple code:

class CTest
{
public:
CTest(void) {};
~CTest(void) {};

The semicolons are superfluous, just like the keywords 'void', but
that's OK. I don't think it is the problem.
};

// In another part of the code
std::vector<CTest> test_vec;
CTest ct;
test_vec.push_back(ct);

What surrounds this "part of code"? What else does the class
CTest have that you're not disclosing?
Doesn't seem like anything unusual to me,

Nothing unusual for us either. Newcomers always post incomplete
code making us guess what the rest of the program looks like...
but VC++ .NET gives me a 2666
error, saying:
std::ptrit<//etc, etc>::eek:perator + : 2 overloads have similar conversions

Am I missing the obvious or is there something else going on?

I don't know. You didn't post enough code to make any meaningful
conclusion. Read the FAQ list, I think FAQ 5.8 should give you
an idea what to do. You can find C++ FAQ Lite on this site:
http://www.parashift.com/c++-faq-lite/

Victor
 
T

Thomas Matthews

BCC said:
Hi,

I have some very simple code:

class CTest
{
public:
CTest(void) {};
~CTest(void) {};
};

// In another part of the code
std::vector<CTest> test_vec;
CTest ct;
test_vec.push_back(ct);


Doesn't seem like anything unusual to me, but VC++ .NET gives me a 2666
error, saying:
std::ptrit<//etc, etc>::eek:perator + : 2 overloads have similar conversions

Am I missing the obvious or is there something else going on?

Thanks,
B

Nothing looks wrong, but you should post the complete
context around your "another part of the code".
See also:
http://www.jelovic.com/articles/stupid_naming.htm


--
Thomas Matthews

C++ newsgroup welcome message:
http://www.slack.net/~shiva/welcome.txt
C++ Faq: http://www.parashift.com/c++-faq-lite
C Faq: http://www.eskimo.com/~scs/c-faq/top.html
alt.comp.lang.learn.c-c++ faq:
http://www.raos.demon.uk/acllc-c++/faq.html
Other sites:
http://www.josuttis.com -- C++ STL Library book
 

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

Forum statistics

Threads
473,776
Messages
2,569,603
Members
45,189
Latest member
CryptoTaxSoftware

Latest Threads

Top