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

C# random value from dictionary and tuple -

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

cgi - How do I interpret URLs without extension as files rather than missing directories in nginx? -