GithubHelp home page GithubHelp logo

Comments (6)

greg7mdp avatar greg7mdp commented on May 25, 2024

Hi @engun , thanks for reporting this.
I'm not using CLion, but I just made a change that I think may fix this. Can you try the latest version of the repo?

from parallel-hashmap.

engun avatar engun commented on May 25, 2024

I just tried it. It's still the same. maybe more detailed information would help.

begin----------------------------------------------------------------------------------------------------------

In template: constexpr variable 'kFirst' must be initialized by a constant expression

error occurred here 
in instantiation of static data member 'phmap::priv::memory_internal::OffsetOf<phmap::priv::memory_internal::IsLayoutCompatible<unsigned long long, unsigned int>::Pair>::kFirst' requested here 
in instantiation of static data member 'phmap::priv::memory_internal::IsLayoutCompatible<unsigned long long, unsigned int>::value' requested here 
in instantiation of function template specialization 'phmap::priv::map_slot_policy<unsigned long long, unsigned int>::transfer<std::allocator<std::pair<const unsigned long long, unsigned int>>>' requested here 
in instantiation of function template specialization 'phmap::priv::FlatHashMapPolicy<unsigned long long, unsigned int>::transfer<std::allocator<std::pair<const unsigned long long, unsigned int>>>' requested here 
in instantiation of function template specialization 'phmap::priv::hash_policy_traits<phmap::priv::FlatHashMapPolicy<unsigned long long, unsigned int>>::transfer_impl<std::allocator<std::pair<const unsigned long long, unsigned int>>, ph... (skipping 4 contexts in backtrace; use -ftemplate-backtrace-limit=0 to see all) 
in instantiation of function template specialization 'phmap::priv::parallel_hash_set<4, phmap::priv::raw_hash_set, std::shared_mutex, phmap::priv::FlatHashMapPolicy<unsigned long long, unsigned int>, phmap::Hash<uint64_t>, phmap::EqualT... 
in instantiation of function template specialization 'phmap::priv::parallel_hash_map<4, phmap::priv::raw_hash_set, std::shared_mutex, phmap::priv::FlatHashMapPolicy<unsigned long long, unsigned int>, phmap::Hash<uint64_t>, phmap::EqualT... 
in instantiation of function template specialization 'phmap::priv::parallel_hash_map<4, phmap::priv::raw_hash_set, std::shared_mutex, phmap::priv::FlatHashMapPolicy<unsigned long long, unsigned int>, phmap::Hash<uint64_t>, phmap::EqualT... 
in instantiation of function template specialization 'phmap::priv::parallel_hash_map<4, phmap::priv::raw_hash_set, std::shared_mutex, phmap::priv::FlatHashMapPolicy<unsigned long long, unsigned int>, phmap::Hash<uint64_t>, phmap::EqualT... 
in instantiation of function template specialization 'phmap::priv::parallel_hash_map<4, phmap::priv::raw_hash_set, std::shared_mutex, phmap::priv::FlatHashMapPolicy<unsigned long long, unsigned int>, phmap::Hash<uint64_t>, phmap::EqualT...

:4387:39:
note: cast that performs the conversions of a reinterpret_cast is not allowed in a constant expression

Declaration location: phmap.h

namespace phmap::priv  
public: 
template<K = key_type, P = Policy, K *  = nullptr> 
MappedReference<P> parallel_hash_map::operator[](key_arg<K> &&key)

end----------------------------------------------------------------------------------------------------------

from parallel-hashmap.

greg7mdp avatar greg7mdp commented on May 25, 2024

What compiler are you using within CLion, on what operating system?

from parallel-hashmap.

engun avatar engun commented on May 25, 2024
  • Compiler: MSVC
  • System: win11 22h2

from parallel-hashmap.

greg7mdp avatar greg7mdp commented on May 25, 2024

Hum, weird, I cannot reproduce the issue with Visual Studio 2022.
Do you have a custom version of the macro offsetof in your code? Either that or you use an older compiler which provides a non constexpr version of offsetof.

from parallel-hashmap.

engun avatar engun commented on May 25, 2024

Yes, VS doesn't show this error and, in fact, doesn't affect CLION compilation, but my OCD tells me to raise an issue.
after a brief study, this error is from the Clang prompt.

from parallel-hashmap.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.