[Vala] Testing generic parameters for numeric type? For method implementation?



How should one test a generic parameter to determine whether or not it is of a numeric type? Should I just go through a long If tree matching it's type name against all of the predefined numeric types?

Is there some way to determine whether a generic parameter responds to to_string()? At run time? (The compiler seems to be very unhappy with attempts to use that unless you cast the parameter to an appropriate type.)



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]