Tessil / hopscotch-map

C++ implementation of a fast hash map and hash set using hopscotch hashing
MIT License
729 stars 65 forks source link

DYNAMIC/hopscotch_map-prefix/src/hopscotch_map/include/tsl/hopscotch_map.h:428:69: error: 'm_ht' was not declared in this scope; did you mean 'ht'? 428 | void swap(hopscotch_map& other) noexcept(noexcept(other.m_ht.swap(m_ht))) { #65

Open jikhashkya opened 1 month ago

jikhashkya commented 1 month ago

Hi,

I'm using a third-party library which uses hopscotch-map. It was working fine until I tried to compile it again and it breaks with the following error:

/home/iam/myproject/test/silly_test/build/external/DYNAMIC/hopscotch_map-prefix/src/hopscotch_map/include/tsl/hopscotch_map.h:428:69: error: 'm_ht' was not declared in this scope; did you mean 'ht'?
  428 |   void swap(hopscotch_map& other) noexcept(noexcept(other.m_ht.swap(m_ht))) {
      |                                                                     ^~~~
      |                                                                     ht

The error goes away if i replace m_ht with this->m_ht. But I can't just do that for now since your library is automatically being built my CMake. Any help would be appreciated. P.S. I'm on a Linux machine with gnu-c++ version 9.3.0.

Thank you.

Tessil commented 1 month ago

Thanks for the report.

It seems to be an issue with g++ 9 as I couldn't reproduce the issue with g++-11 to g++14 (and clang and MSVC in the CI work well). Do you eventually have a more recent version of gcc?

Otherwise could you try this branch https://github.com/Tessil/hopscotch-map/tree/gcc_9_swap?

jikhashkya commented 1 month ago

@Tessil Thanks for the quick response . It does seem to be an issue with g++ 9 since I didn't have that issue with other versions. I don't have access to other versions in the cluster that I'm working right now but I'll try out the branch that you suggested.