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

Popular posts from this blog

database - VFP Grid + SQL server 2008 - grid not showing correctly -

jquery - Set jPicker field to empty value -

.htaccess - htaccess convert request to clean url and add slash at the end of the url -