Swift functions, generics and multiple protocols

Recently I needed to create a function that took as its parameter a Type that conformed to two protocols and I learned there are two ways to acomplish this using a where clause or protocol composition in the functions generic parameter types.


The where clause method will also work with classes to enforce subclassing