?
Solved

problem with vectors

Posted on 2003-03-10
2
Medium Priority
?
227 Views
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
0
Comment
Question by:BungoMan
2 Comments
 

Accepted Solution

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

Author Comment

by:BungoMan
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;

b1.b=rand();
b2.setto(b1);

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

oh well, thanks tho
0

Featured Post

Concerto's Cloud Advisory Services

Want to avoid the missteps to gaining all the benefits of the cloud? Learn more about the different assessment options from our Cloud Advisory team.

Question has a verified solution.

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

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…
IntroductionThis article is the second in a three part article series on the Visual Studio 2008 Debugger.  It provides tips in setting and using breakpoints. If not familiar with this debugger, you can find a basic introduction in the EE article loc…
The goal of the tutorial is to teach the user how to use functions in C++. The video will cover how to define functions, how to call functions and how to create functions prototypes. Microsoft Visual C++ 2010 Express will be used as a text editor an…
The viewer will learn how to clear a vector as well as how to detect empty vectors in C++.
Suggested Courses

578 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