C++ Logo

std-discussion

Advanced search

Re: Trying to solve how to do a std::unordered_map<std::pair<..., ...>, ...>

From: Edward Catmur <ecatmur_at_[hidden]>
Date: Mon, 2 Oct 2023 13:06:14 -0600
On Mon, Oct 2, 2023, 13:01 Aaron Gray via Std-Discussion <
std-discussion_at_[hidden]> wrote:

> On Mon, 2 Oct 2023 at 19:45, Edward Catmur via Std-Discussion
> <std-discussion_at_[hidden]> wrote:
> >
> > And don't try to specialize hash on unconstrained std::pair; it isn't
> yours. Write a separate hash class to use explicitly if you must.
>
> Edward,
>
> So this is okay :-
>
> template<>
> struct hash<pair<Type *, Type *>> { .. }
>
> but
>
> template<typename T>
> struct hash<pair<T *, T *>> { .. }
>
> is not ?
>

Correct.

Received on 2023-10-02 19:06:28