Currently, my code looks like this:

```
struct Node<T>: Hashable
where T: Equatable, T: Hashable {
....
}
```

Is there a more easy notation to write the same thing? Thanks!

Currently, my code looks like this:

```
struct Node<T>: Hashable
where T: Equatable, T: Hashable {
....
}
```

Is there a more easy notation to write the same thing? Thanks!

`Hashable`

refines `Equatable`

so your constraint can just be `where T: Hashable`

βor were you looking for a syntax for the general `struct S<T>: P where T: P`

construct for arbitrary `P`

?

Thanks,

I was looking for what is the syntax for specifying two constraints on the same type more concisely than repeating the type.

You can use `T: P & Q`

to avoid repetition.

4 Likes

```
struct Node<T: Hashable>: Hashable {
...
```

3 Likes