-
Notifications
You must be signed in to change notification settings - Fork 57
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
Cannot explicitly instantiate unordered_flat_map/set
without also including concurrent version
#286
Comments
To fix this, you'd have to include the concurrent_flat_map header, too:
|
This adds a TBB dependency to my GCC (but not for Clang). I suspect there is a |
Just trying to understand the scenario... this particular problem could be solved by adding template<bool avoid_explicit_instantiation = true> to the offending constructor. How useful is an explicitly instantiated container in your scenario? Many of its member functions are templatized, so does that mean they won't be seen by user code when the container is imported from a module? |
I'm not currently able to build using C++ modules due to other problems. A function that called a This was a problem in particular for many So, I wasn't explicitly instantiating for the usual reason of saving compile times by trying to compile only once, but because it prevented modules from working at all. Here is an example stack trace, that I just reproduced on a recent clang master:
This goes away with an explicit instantiation. However, that is a Clang bug that will hopefully be fixed in the not too distant future. llvm/llvm-project#98021 |
Thanks for the explanation. My proposal would be to then wait and see if llvm/llvm-project#98021 gets fixed soon, otherwise I guess we can go with the |
@chriselrod can you confirm if you can succesfully use modules with Boost.Unordered after this change? Thank you! |
Minimal reproducer:
This is with boost 1.86. I get the error with both gcc 14 and clang 18.
The problem is that explicit instantiation tries to instantiate this method, referencing a member of an incomplete type:
unordered/include/boost/unordered/unordered_flat_map.hpp
Lines 185 to 189 in 57546ed
Unfortunately, explicit instantiation is necessary when using c++20 modules with Clang to work around #261.
The text was updated successfully, but these errors were encountered: