protocol conformance question

Is there a way I can specify that all integer types conform to MyProtocol without naming them explicitly like this??

protocol MyProtocol {}
extension String: MyProtocol {}
extension Int: MyProtocol {}
extension UInt8: MyProtocol {}
[...]

I tried the following:
extension FixedWidthInteger: MyProtocol {}
but get "error: extension of protocol 'FixedWidthInteger' cannot have an inheritance clause".

Thanks,
Frank

The information contained in this electronic communication and any document attached hereto or transmitted herewith is confidential and intended for the exclusive use of the individual or entity named above. If the reader of this message is not the intended recipient or the employee or agent responsible for delivering it to the intended recipient, you are hereby notified that any examination, use, dissemination, distribution or copying of this communication or any part thereof is strictly prohibited. If you have received this communication in error, please immediately notify the sender by reply e-mail and destroy this communication. Thank you.

1 Like