problem with vectors

Posted on 2003-03-10
Medium Priority
Last Modified: 2013-12-14
for some reason i keep getting the following error

c:\program files\microsoft visual studio\vc98\include\xutility(39) : error C2679: binary '=' : no operator defined which takes a right-hand operand of type 'const class item' (or there is no acceptable conversion)
        c:\program files\microsoft visual studio\vc98\include\vector(170) : see reference to function template instantiation 'void __cdecl std::fill(class item *,class item *,const class item &)' being compiled
Error executing cl.exe.

i have it so there is a class that has a two vectors, both are vectors with another class i have in them. i doubt that is what is causing the error, but there are no obvious syntax errors... anyone out there got any idea as to what might cause this error? and if so how do i fix it? if you need me to i can post all the relevant code
Question by:BungoMan
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions

Accepted Solution

peter_sheynkman earned 100 total points
ID: 8109273
You may need to define operator = for the class that vector uses.

Author Comment

ID: 8109300
actualy the problem was that i HAD defined it. when i commented out the = operator for that class it compiled and linked just fine

now im gonna need to find a way to overload the = operator and make it work... perhaps i could just use a function like this

//assuming bungo is a defined class and setto is a function in the class bungo and b is an int

bungo b1;
bungo b2;


something like that would work, but id much rather do
b2=b1; =/

oh well, thanks tho

Featured Post

Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

When writing generic code, using template meta-programming techniques, it is sometimes useful to know if a type is convertible to another type. A good example of when this might be is if you are writing diagnostic instrumentation for code to generat…
This article will show you some of the more useful Standard Template Library (STL) algorithms through the use of working examples.  You will learn about how these algorithms fit into the STL architecture, how they work with STL containers, and why t…
The viewer will learn how to use and create keystrokes in Netbeans IDE 8.0 for Windows.
The viewer will learn how to pass data into a function in C++. This is one step further in using functions. Instead of only printing text onto the console, the function will be able to perform calculations with argumentents given by the user.
Suggested Courses

765 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question