Why C++ doesn't allow template overloading?

Viewed 287

Sometime I want to write two templates like:

template <typename Type1>
class A{
    ...
};

template <typename Type1, typename Type2>
class A{
    ...
};

But it seems that it is illegal to have two templates shared the same name but have different parameters. I have to name it like A_1, A_2. I think it might be useful if I can do this especially when implementing Functors.

Why C++ doesn't allow this? Does it difficult to implement or have ambiguity in some circumstance? Will this be supported on later version of C++?

2 Answers
Related