Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

GCC 9.3.0 compilation error #1

Open
AlexBolotsin opened this issue Aug 4, 2021 · 0 comments
Open

GCC 9.3.0 compilation error #1

AlexBolotsin opened this issue Aug 4, 2021 · 0 comments

Comments

@AlexBolotsin
Copy link

AlexBolotsin commented Aug 4, 2021

Hi,

Nice example of intrinsic geometry you have here.
MarchingCubes.cpp method merge_vertex uses iterators to find a vertex set.
On fresh ubuntu 20.04 it generates an error:

marchingcubes.cpp:464:10: error: no match for ‘operator!=’ (operand types are ‘std::unordered_set<Vertex*>::const_iterator’ {aka ‘std::__detail::_Node_const_iterator<Vertex*, true, false>’} and ‘std::unordered_set<Vertex*, vertex_hash, vertex_equals>::const_iterator’ {aka ‘std::__detail::_Node_const_iterator<Vertex*, true, true>’})
  464 |     if(u != vertex_set.cend()) {
      |        ~ ^~ ~~~~~~~~~~~~~~~~~
      |        |                   |
      |        |                   _Node_const_iterator<[...],[...],true>
      |        _Node_const_iterator<[...],[...],false>

3rd value of template is different which make em different types.

There is a quickfix for it

diff --git a/marchingcubes.cpp b/marchingcubes.cpp
index 3a6ffed..8254cb5 100644
--- a/marchingcubes.cpp
+++ b/marchingcubes.cpp
@@ -459,9 +459,9 @@ bool is_degenerate(Vertex* v0, Vertex* v1, Vertex* v2)
 
 Vertex* merge_vertex(Vertex* v, unordered_set<Vertex*, vertex_hash, vertex_equals>& vertex_set, Mesh& mesh)
 {
-    unordered_set<Vertex*>::const_iterator u = vertex_set.find(v);
+    unordered_set<Vertex*, vertex_hash, vertex_equals>::const_iterator u = vertex_set.find(v);
 
-    if(u != vertex_set.end()) {
+    if(u != vertex_set.cend()) {
         delete v;
         return *u;
     }
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant