Hello, i have the following code compiled with GCC 4.2 / XCode.
template <typename T>
class irrProcessBufferAllocator
{
public:
T* allocate(size_t cnt)
{
return allocProcessBufferOfType<T>(cnt);
}
void deallocate(T* ptr)
{
if (ptr)
{
releaseProcessBuffer(ptr);
}
}
void construct(T* ptr, const T& e)
{
new ((void*)ptr) T(e);//"error: expected type-specifier before 'e' " and
//error: expected `;' before 'e'
}
void destruct(T* ptr)
{
ptr->~T();//error: expected class-name before ';' token
}
};
i really can't figure out how to fix the errors. please help,
Thanks.