Boost logo

Boost Users :

Subject: [Boost-users] Errors while trying to build boost::priority_queue
From: Ram (sourceopen_at_[hidden])
Date: 2017-12-09 04:02:31


Hi,

When I try to build "priority_queue_example.cpp" it get these warnings(and
so errors) pointing to "priority_queue_example.h" on the line where my
priority_queue is declared. The warnings are,

1> priority_queue_example.cpp
1>c:\Projects\lib\boost\boost\heap\detail\stable_heap.hpp(102): error
C2220: warning treated as error - no 'object' file generated
1>c:\Projects\lib\boost\boost\heap\detail\stable_heap.hpp(102): warning
C4100: 'rhs' : unreferenced formal parameter
1> c:\Projects\lib\boost\boost\heap\detail\stable_heap.hpp(102) :
while compiling class template member function
'boost::heap::detail::size_holder<false,size_t>::size_holder(const
boost::heap::detail::size_holder<false,size_t> &)'
1> c:\Projects\lib\boost\boost\heap\detail\stable_heap.hpp(189) :
see reference to function template instantiation
'boost::heap::detail::size_holder<false,size_t>::size_holder(const
boost::heap::detail::size_holder<false,size_t> &)' being compiled
1> c:\Projects\lib\boost\boost\heap\detail\stable_heap.hpp(151) :
see reference to class template instantiation
'boost::heap::detail::size_holder<false,size_t>' being compiled
1> c:\Projects\lib\boost\boost\heap\priority_queue.hpp(65) : see
reference to class template instantiation
'boost::heap::detail::heap_base<T,myObjectPtrCompare,false,unsigned
__int64,false>' being compiled
1> with
1> [
1> T=myObject *
1> ]
1> c:\Projects\priority_queue_example.h(193) : see reference to
class template instantiation 'boost::heap::priority_queue<myObject
*,boost::heap::compare<myObjectPtrCompare>,boost::parameter::void_,boost::parameter::void_,boost::parameter::void_>'
being
compiledcompare<ObjectPtrCompare>,boost::parameter::void_,boost::parameter::void

My priority_queue is declared as,

mutable boost::heap::priority_queue<myObject*,
boost::heap::compare<myObjectPtrCompare> > hp;

Can you please help me fix this, I have been trying to for 2 days. Not sure
what this means.

This is my comparison class defined,

struct myObjectPtrCompare
{
bool operator()(const myObject* lhs, const myObject* rhs) const
{
return (lhs->getProp() < rhs->getProp());
}
};

Thanks!



Boost-users list run by williamkempf at hotmail.com, kalb at libertysoft.com, bjorn.karlsson at readsoft.com, gregod at cs.rpi.edu, wekempf at cox.net