我目前有类似的东西在Visual Studio中工作正常但是我在Mingw中得到以下错误
error: specializing member '{anonymous}::Buffer<{anonymous}::VertexBufferFactory, IDirect3DVertexBuffer9*, ktVertexBuffer>::applyBuffer' requires 'template<>' syntax
void VertexBuffer::applyBuffer(uint32_t no, uint32_t stride, uint32_t offset)
^
代码是
typedef Buffer<VertexBufferFactory, ddVertexBuffer,VertexBuffer> VertexBuffer;
void VertexBuffer::applyBuffer(uint32_t no, uint32_t stride, uint32_t offset)
{
Gpu::ddSetStreamSource(no, buffer, offset, stride);
}
缓冲区的模板声明是
template <class FACTORY, class BUFFER, class BASE>
class Buffer : public BASE {
}
有关我为什么会收到此错误以及如何解决此问题的任何建议?
答案 0 :(得分:1)
您似乎正在定义(完全)专用类模板(applyBuffer
)的成员(Buffer
)。其语法使用{/ 1}},如
template<>