The standard N4296::13.1/2.2 [over.load]says:
Similarly, declarations of templates of member functions with the same name, the same list of parameter parameters and the same parameter parameters of the template cannot be overloaded if any of them is a function of the static member declaration template.
So, I thought the following program would be poorly formed:
#include <iostream>
struct A
{
template <typename T>
static void foo(){ }
template <typename T>
static int foo(){ return 0; }
};
int main(){ }
Demo
Unlike the program
#include <iostream>
struct A
{
static void foo(){ }
static int foo(){ return 0; }
};
int main(){ }
poorly formed
Demo
Is the first example a mistake?
user2953119
source
share