{"action":"closed","issue":{"url":"https://api.github.com/repos/PixarAnimationStudios/OpenSubdiv/issues/622","labels_url":"https://api.github.com/repos/PixarAnimationStudios/OpenSubdiv/issues/622/labels{/name}","comments_url":"https://api.github.com/repos/PixarAnimationStudios/OpenSubdiv/issues/622/comments","events_url":"https://api.github.com/repos/PixarAnimationStudios/OpenSubdiv/issues/622/events","html_url":"https://github.com/PixarAnimationStudios/OpenSubdiv/issues/622","id":86921015,"number":622,"title":"VS2013 Build Errors - more than one [] operator for StackBuffer","user":{"login":"thomthom","id":192418,"avatar_url":"https://avatars.githubusercontent.com/u/192418?v=3","gravatar_id":"","url":"https://api.github.com/users/thomthom","html_url":"https://github.com/thomthom","followers_url":"https://api.github.com/users/thomthom/followers","following_url":"https://api.github.com/users/thomthom/following{/other_user}","gists_url":"https://api.github.com/users/thomthom/gists{/gist_id}","starred_url":"https://api.github.com/users/thomthom/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/thomthom/subscriptions","organizations_url":"https://api.github.com/users/thomthom/orgs","repos_url":"https://api.github.com/users/thomthom/repos","events_url":"https://api.github.com/users/thomthom/events{/privacy}","received_events_url":"https://api.github.com/users/thomthom/received_events","type":"User","site_admin":false},"labels":[],"state":"closed","locked":false,"assignee":null,"milestone":null,"comments":12,"created_at":"2015-06-10T10:35:45Z","updated_at":"2015-06-11T17:21:33Z","closed_at":"2015-06-11T17:21:33Z","body":"I observe build errors in Visual Studio 2013 (OpenSubdiv 3.0.0 RC1).\r\n\r\nCMake config to generate Vs solution:\r\n\r\n```cmake\r\ncmake ^\r\n  -G \"Visual Studio 12 2013\" ^\r\n  -DNO_EXAMPLES=1 ^\r\n  -DNO_TUTORIALS=1 ^\r\n  -DNO_REGRESSION=1 ^\r\n  -DNO_MAYA=1 ^\r\n  -DNO_PTEX=1 ^\r\n  -DNO_DOC=1 ^\r\n  -DNO_OMP=1 ^\r\n  -DNO_TBB=1 ^\r\n  -DNO_CUDA=1 ^\r\n  -DNO_OPENCL=1 ^\r\n  -DNO_OPENGL=1 ^\r\n  -DNO_CLEW=1 ^\r\n  ..\r\n```\r\n\r\nFull error list upon build: https://gist.github.com/thomthom/cfadd7d384d8b394aabb\r\n\r\n![2015-06-10_11h46_50](https://cloud.githubusercontent.com/assets/192418/8080347/05ad9a46-0f6c-11e5-804d-88da034cad7d.png)\r\n\r\nAll the errors appear to be related to the same thing. Patterns like this:\r\n\r\n```cpp\r\n    internal::StackBuffer<Index,16> cVertEdgeBuffer;\r\n\r\n    ConstIndexArray pVertEdges = _parentLevel.getVertexEdges(pVert);\r\n    ConstIndexArray cVertEdges;\r\n\r\n    //  Beware accessing the child's vert-edges -- full topology may not be enabled:\r\n    if (_childLevel.getNumVertexEdgesTotal()) {\r\n        cVertEdges = _childLevel.getVertexEdges(cVert);\r\n    } else {\r\n        cVertEdgeBuffer.SetSize(pVertEdges.size());\r\n\r\n        ConstLocalIndexArray pVertInEdge = _parentLevel.getVertexEdgeLocalIndices(pVert);\r\n        for (int i = 0; i < pVertEdges.size(); ++i) {\r\n            cVertEdgeBuffer[i] = _refinement.getEdgeChildEdges(pVertEdges[i])[pVertInEdge[i]];\r\n        }\r\n        cVertEdges = IndexArray(cVertEdgeBuffer, pVertEdges.size());\r\n    }\r\n```\r\n\r\nIt's the `cVertEdgeBuffer[i]` that chokes - VS doesn't like `int` being passed to `[]` which signature accepts `unsigned int`.\r\n\r\nIf I made a `static_cast` of `i` then there'd be no error.\r\n\r\nAs a quick and dirty test I added an overload to `StackBuffer` and that allowed the build to complete with no errors:\r\n\r\n```cpp\r\n    TYPE &       operator[](int index)        { return _data[static_cast<size_type>(index)]; }\r\n    TYPE const & operator[](int index) const  { return _data[static_cast<size_type>(index)]; }\r\n```\r\n![2015-06-10_12h21_08](https://cloud.githubusercontent.com/assets/192418/8080442/dc187f60-0f6c-11e5-8194-db3556825475.png)\r\n\r\nI would submit a patch, but I'm not sure what the preferred fix would be. (Plus I saw that I need to sign that agreement before submitting contributions.)"}}