-
Notifications
You must be signed in to change notification settings - Fork 2
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
cpp: make isl objects compatible with standard containers. #13
Comments
The bindings are already C++11 of larger. Not sure if this would change anything regarding the separate file. And yes, I think it would be great to systematically think about less-than and hashability. Your point of needing a std::hash for id was a certainly a good one. |
Sorry, I've mistaken that for the generator file, which is not C++11. Nevermind. For hashes there are two options: either we can wrap around |
This likely depends what you want. isl_*_get_hash gives identical hashes for different objects that model the same set. The pointer does not carry this information. |
Well, I think it is reasonable to expect hashes of logically equal (i.e. represent the same set) values to be equal. |
There are good reasons for expecting logical equality. On the other side, hashing can be expensive this way. Assume you insert a large isl::set into a hashtable and you first need to scan the full isl::set. I feel there is a tradeoff. |
In particular,
std::set
andstd::map
expect objects to be less-than-comparable andstd::unordered_set
andstd::unordered_map
to have a specialization ofstd::hash
.C++11 stuff could go in a separate file that is conditionally included based on the C++ version.
The text was updated successfully, but these errors were encountered: