所以我得到一个奇怪的错误,当我编译我的程序:缺少';'前“模板<”
Error 1 error C2143: syntax error : missing ';' before ''template<''
我做的一切都非常标准的;没有什么与众不同的:
#ifndef HEAP_H
#define HEAP_H
//**************************************************************************
template<typename TYPE>
class Heap
{
private:
TYPE* heapData;
int currSize;
int capacity;
void _siftUp(int);
void _siftDown(int);
int _leftChildOf(int) const;
int _parentOf(int) const;
public:
Heap(int c = 100);
~Heap();
bool viewMax(TYPE&) const;
int getCapacity() const;
int getCurrSize() const;
bool insert(const TYPE&);
bool remove(TYPE&);
};
不太清楚什么是错的。我尝试关闭并重新打开我的程序 - 没有运气。使用Visual Studio 2010
您是否包含另一个在类定义之后没有分号的头? – chris
我的钱是你不向我们展示的代码:) – jrok
你'#include'ing任何头? – 0x499602D2