I am having this template matching error. I know partial specialization is not allowed in for function template, but I think it should work with full specialization. What change do I need to make to fix this issue ? Thanks.
#include <iostream> template<typename T> void allocate(){ std::cout << "default" << std::endl; } template<> void allocate<int>() { std::cout << "int" << std::endl; } template<> void allocate<double>() { std::cout << "double" << std::endl; } int main() { allocate(); // Compiler error, I expect this should match the first template function. allocate<int>(); allocate<double>(); return 0; }