Right, I'm trying to build a DLL using VSC++ 2005. I get numerous compilation errors, the first being "type 'int' unexpected", continuing with similarities such as "unexpected tokens preceding ';'".
Here's the first reported erroneous file:
(What the hell?)
Code:
#ifndef _OSAOU_SCRIPT_PARSER_HEAP_HPP_
#define _OSAOU_SCRIPT_PARSER_HEAP_HPP_
// INCLUDES
#include <vector>
// CLASS DECLARATION
namespace osaou{
namespace script{
namespace parser{
class Variable;
class Heap{
public:
Heap(int index, size_type capacity); <--- "type 'int' unexpected"
~Heap();
Variable* get(int v) const { return m_vars[v]; }
void remove(int v){ m_vars[v] = NULL; }
void free(int v){
// free memory, if this was the last referer
m_vars[v]->release();
// remove variable from heap
remove(v);
}
void insert(int v, Variable* var){
// check if we've reached the quota
if ( v >= m_vars.capacity() ){
// reserve more space for this heap
m_vars.reserve( m_vars.capacity() + m_capacity );
}
// insert variable
m_vars[v] = var;
// increment referers to this variable
var->addRef();
}
private:
std::vector< Variable* > m_vars;
const size_type m_capacity;
const int m_index;
};
}
}
}
#endif