I\'m trying to have a function take a generic input that conforms to both a class and a protocol in order to process values where some belong to the class and others belong