Browse Source

egg: work around compiler bug in Visual Studio 2017

Fixes #379
rdb 7 years ago
parent
commit
3417b9df09
1 changed files with 8 additions and 0 deletions
  1. 8 0
      panda/src/egg/eggVertexPool.cxx

+ 8 - 0
panda/src/egg/eggVertexPool.cxx

@@ -677,7 +677,15 @@ transform(const LMatrix4d &mat) {
     typedef pvector<EggVertex *> Verts;
     Verts verts;
     verts.reserve(size());
+
+    // Work around MSVC 2017 compiler bug, see GitHub issue #379
+#ifdef _MSC_VER
+    for (const IndexVertices::value_type &v : _index_vertices) {
+      verts.push_back(v.second);
+    }
+#else
     std::copy(begin(), end(), std::back_inserter(verts));
+#endif
 
     Verts::const_iterator vi;
     for (vi = verts.begin(); vi != verts.end(); ++vi) {