Re: [swift-users] Detect if a generic type is numeric

2017-10-01 Thread V T via swift-users
> On 1. Oct 2017, at 22:43, davel...@mac.com wrote: > > > >> On Oct 1, 2017, at 2:32 PM, Glenn L. Austin <gl...@austinsoft.com> wrote: >> >>> >>> On Oct 1, 2017, at 8:56 AM, Dave Reed via swift-users >>> <swift-users@swift.org

[swift-users] Detect if a generic type is numeric

2017-09-21 Thread V T via swift-users
Hi there! Is there a best way to check if a given type conforms to numeric protocol (Integer or FP) at runtime? func checkNumeric(_ value: T) { /* return true if vaiue is Integer or FP */ /* this will not compile: */ if value is Numeric { } }