Hi there!

Is there a best way to check if a given type conforms to numeric protocol 
(Integer or FP) at runtime?

func checkNumeric<T>(_ value: T) {
        /* return true if vaiue is Integer or FP */
        /* this will not compile: */
        if value is Numeric {
                
        }
}
 
Best regards!

VT
_______________________________________________
swift-users mailing list
swift-users@swift.org
https://lists.swift.org/mailman/listinfo/swift-users

Reply via email to