Comments (15)
@kleunen Can I go ahead and close this issue or is there anything else you'd like to add/ask about?
from unordered.
I think I figured it out myself now, it seems unordered_map does not detect by itself it can use allocator traits and cxx11 construction with libc++. I had to add these defines:
#define BOOST_UNORDERED_USE_ALLOCATOR_TRAITS 1
#define BOOST_UNORDERED_CXX11_CONSTRUCTION 1
#include <boost/unordered_map.hpp>
I think it would be good to add detection of llvm libc++ to unordered_map, now that it is used more often
from unordered.
Hi kleuen!
Unfortunately, I tried recreating your issue but everything compiles:
https://godbolt.org/z/hePrb5YGq
It's not a perfect recreation of your exact setup but should be similar enough so as to trigger an error.
Could I possibly get some more information about your setup?
My question is: what compiler are you using? I'm guessing you're using Apple Clang which unfortunately I can't easily reproduce.
I'm also wondering, what C++ version? If I have more information around your compiler version and the C++ standard, I might have better luck recreating the issue.
from unordered.
The issue occured on the Github CI setup, so the virtual environment of Github CI with macos was used.
I am not sure what version that was, possibly this is already been updated.
from unordered.
Would you be able to provide a smaller, minimal example that causes the failure you experienced?
from unordered.
I have to think about that. Actually, i am not using the scoped_allocator anymore. It was easier to use a stateless allocator, so I made a workaround with a global allocator.
The example you showed was similar to the code I was using.
from unordered.
Ha ha, no worries.
You made me realize, Unordered actually doesn't have a test case like what you mentioned. So I'm going to work on adding it to the CI test matrix and then hopefully, we'll be able to trigger a failure.
from unordered.
If i have time, i will have a look if i can break it. I have some old test code lying around.
from unordered.
This was a code sample i made:
https://godbolt.org/z/9snoYPM8q
On godbolt it seems to compile fine, so maybe really related to macos ?
from unordered.
Yeah, I'm guessing it's probably some weirdness surrounding Apple Clang specifically. Maybe just not a robust enough check on the side of Unordered.
Thank you for the godbolt link!
from unordered.
My guess was that libc++ on macos was missing certain defines.
from unordered.
Hi @kleunen, I have a PR up: #31
Would you mind taking a look and seeing if this mirrors your use-case sufficiently simplified?
The Github Actions test matrix does include OS X and unfortunately, a compiler error doesn't seem to have been triggered.
from unordered.
I will have a look.
Yes, I think the macos virtual environment is probably upgraded now.
Also ubuntu 16.04 was removed recently, so.
from unordered.
The PR looks good. You are checking now the stateful scoped allocator is passed to the underlying vector inside the map. So, at least you have a test for this now, to make sure the C++ environment is handling this correctly.
from unordered.
Awesome, then I'll work on fixing the msvc compilation failures (so hey, at least we found one failure in the test matrix) and then we'll get this bad boy merged!
from unordered.
Related Issues (20)
- Missing reference docs for `insert_or_assign`
- No implementation for `merge()`ing map and multimap/set and multiset HOT 3
- Can you add redirects HOT 9
- Too many (separate) tests?
- Delete merged and stale branches HOT 1
- Have you considered keeping the calculated hashes in the table entries? HOT 2
- [Request] Make `unordered_map` as fast as Dinkumware's implementation
- unordered_set move leads to crash in 1.80.0 HOT 3
- [develop] `rehash` doing unnecessary reallocations
- Incomplete deduction guidelines
- No implementation of P2363 HOT 3
- prime_fmod.hpp:120 triggers a runtime check failure #1 on msvc HOT 8
- Missing constructors, LWG Issue 2713
- Implement POC of linear search for sufficiently small hash tables
- Implement .natvis files for containers
- Implement group14 for foa containers HOT 1
- Implement unordered_flat_node_map POC HOT 2
- Incomplete implementation of resolution to LWG issue 2713 HOT 1
- Forceinline improves performance significantly with MSVC HOT 3
- Extract throw_exception calls into noinline function(s)
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from unordered.