使用升压fibonacci_heap
Using boost fibonacci_heap
使用fibonacci_heap
会导致编译错误:
struct Less: public binary_function<Node*, Node*, bool>
{
bool operator()(const Node*& __x, Node*& __y) const
{ return __x->time < __y->time; }
};
boost::fibonacci_heap<Node*, Less >* m_heap;
然后
Less* ls = new Less;
m_heap = new boost::fibonacci_heap<Node*, Less >(1000, (*ls));
任何运行m_heap->push(n)
的尝试都会导致
no match for call to ‘(TimeSync::Less) (TimeSync::Node* const&, TimeSync::Node*&)’
UnmanagedUtils/Trading/Simulation/TimeSync.h:50: note: candidates are: bool TimeSync::Less::operator()(const TimeSync::Node*&, TimeSync::Node*&) const
/usr/local/include/boost-1_35/boost/property_map.hpp: In function ‘Reference boost::get(const boost::put_get_helper<Reference, PropertyMap>&, const K&) [with PropertyMap = boost::identity_property_map, Reference = unsigned int, K = TimeSync::Node*]’:
将签名更改为 operator()(Node * const &, Node * const &) const
。
相关文章:
- 为什么我的 heap.h 文件给我一个LNK2001错误?
- 当为可变性配置时,boost::heap::d_ary_heap 保留的额外 std::list 的目的是什么?
- 了解 Linux 虚拟内存:valgrind 的 massif 输出显示了有和没有 --pages-as-heap 的主要差异
- 从 MSVC14 切换到 MSVC16 会导致"compiler is out of heap space (C1060)"错误
- 庞大的初始化列表,如何修复"fatal error C1060: compiler is out of heap space"
- 我试图用c++编写递归fibonacci序列,但当我编译时,我遇到了一个错误
- 在析构函数中调用"delete"运算符时"compiler is out of heap space"编译器错误
- 在 boost::heap::p riority_queue 中推送结构对象时出错
- QCoreApplication on the heap
- 用于创建Min-Heap的算法
- C 中的fibonacci Memoization算法
- 巨大的fibonacci模mC++
- 为什么这段代码会导致"heap corruption detected"?
- 如何使用模板使用fibonacci编号创建编译时的模板/数组/矢量
- Min-Heap,基于零的数组C
- STL for Fibonacci Heap?
- Windows heap corruption C++C
- 如何提高Boost Fibonacci堆的性能
- C 将HEAP对象插入std ::用insert()插入映射,而另一个则存在删除新的对象
- 在windbg中"!heap -h"输出中"Internal"的含义是什么?