On 16 April 2017 at 20:51, Giuseppe D'Angelo <[email protected]> wrote:
> Il 16/04/2017 18:32, Corentin ha scritto:
>>
>> More on point:
>>    * You don't actually need to include anything from the STL to
>> implement std::hash.
>
> You actually do: you need <functional> to see the primary template for
> std::hash (otherwise you can't specialize it). Also, how to implement it
> is another burden (see the other discussion).

You don't need to include a header to do that:

namespace std {
    template <class T> struct hash;
}

Now you can specialize hash for your own types.

I don't think that violates any rule; it's not adding a declaration to
namespace std, as that
declaration is already there.
_______________________________________________
Development mailing list
[email protected]
http://lists.qt-project.org/mailman/listinfo/development

Reply via email to