Better HN
top
new
best
ask
show
jobs
Log in
Sign up
Better HN
Comment
by
andrepd
· 8y ago · 0 comments
This one works too, if they are implicitly convertible (e.g. max(1, 2.0))
Comments
[–]
bstamour
8y ago
No it won't. You'll get a compile time error, as T could either deduce to int or double. Unless you explicitly specify it as max<int>(1, 2.0) or max<double>(1, 2.0).