On Sunday, September 23, 2012 06:37:30 Craig Dillabaugh wrote: > One question. Is there any way to get the function template to > deduce the type of T from the vertices I pass, so that I can > call: > > euclid_dist(v1, v2) ) > > instead of: > > euclid_dist!float(v1, v2) );
It should infer the types just fine as-is. Templated functions can pretty much always infer the template arguments from their function arguments. It's with types that that doesn't work (so a constructor requires template arguments, but a function does not). - Jonathan M Davis