Good day to everyone!
I have:
“ClassA.h”
class ClassA
{
....
public:
priority_queue<OBJECT*, vector<OBJECT*>, compound_objectNS::compare> m_prior_queue_Objects;
....
}
“ClassB.h”
class ClassB
{
void someFunction(void);
ClassA* m_network;
}
“ClassB.cpp”
void ClassB::someFunction(void)
{
vector<Compound_object*>::const_iterator vit;
vit = this->m_network->m_prior_queue_Objects.top();
- and here I get from iSense – Error no operator “=” matches this operands.
What is wrong?!
}
Update: typedef Compound_object* OBJECT*
priority_queue::top()returns a const reference to an element, and you are trying to assign to an iterator. You can do two things:Instantiate a (const or non-const) pointer from the const reference to pointer:
Instantiate a const reference to pointer from the return.