c++ - Deducing template parameter from default parameter -
this question has answer here:
why doesn't c++11 program work:
template <typename t> void f(t t = 42) {}  int main() { f(); } why can't t deduced default argument 42?
14.8.2.5 [temp.deduct.type]:
19 - template type-parameter cannot deduced type of function default argument. [...]
the example given substantially same yours.
Comments
Post a Comment