在构建[OpenSubdiv](http://graphics.pixar.com/opensubdiv/docs/cmake_build.html)时遇到以下错误:
error C2666: 'OpenSubdiv::v3_0_0_beta::Vtr::internal::StackBuffer<TYPE,SIZE>::operator []' : 4 overloads have similar conversions
触发错误的代码行是:
for (int i = 0; i < pVertEdges.size(); ++i) {
cVertEdgeBuffer[i] = _refinement.getEdgeChildEdges(pVertEdges[i])[pVertInEdge[i]];
}
实例是:
internal::StackBuffer<Index,16> cVertEdgeBuffer(_childLevel._maxValence);
StackBuffer类中的重载operator []似乎有些含糊不清
template <typename TYPE, unsigned int SIZE>
class StackBuffer
{
StackBuffer();
StackBuffer(size_type size);
~StackBuffer();
public:
TYPE & operator[](size_type index) { return _data[index]; }
TYPE const & operator[](size_type index) const { return _data[index]; }
operator TYPE const * () const { return _data; }
operator TYPE * () { return _data; }
};
我将编译从VS2012更改为VS2010,但错误仍然存在。
这个错误是由于OpenSubdiv的来源还是由于我的Cmake配置?我按照OpenSubdiv的要求添加了所有依赖项。
答案 0 :(得分:1)
此问题已在OpenSubdiv(dev-branch)中修复 https://github.com/PixarAnimationStudios/OpenSubdiv/issues/622#issuecomment-111051840