
Peter Dimov wrote:
Thorsten Ottosen wrote:
3. consider if the primary template should not take 1 range parameter and call hash_range; unordered containers can then be explicitly overloaded when they become available. this would also have the great effect that subranges like sub_range<string> "just works" by default
I don't remember this being discussed during the review, could you please explain it in more detail? Do you mean that hash_value should have a primary template that assumes that its argument is a range? If so, I strongly oppose it. Ranges aren't special from the point of view of hash_value, they shouldn't monopolize the primary template. The proper way to make hash_value work with sub_range<T>, as with any other type, is for sub_range to define a hash_value overload as an inline friend or in its namespace.
I think Thorsten is referring in part to some off list emails, and in part to when I wrote (about removing the includes for all the standard containers):
Another possible solution is to just use Boost.Range on anything that 'looks' like a container. But this will break on unordered containers (as equivalent containers can have different sequences).
I forgot to mention that there's no way to tell what 'looks' like a container at all. JoaquĆn replied:
Too broad IMHO.
So, I think we all rejected the idea. It would be nice if there was a way to do something like that, but there isn't. Daniel