0

Why does the following code fail with C2373 "redefition; different type modifiers"?

template <class T>
struct A
{
  static int (*f)(T);
};

int g(int i)
{
  return i + 3;
}

auto A<int>::f = g; // C2373 refers to this line

int main()
{
  A<int>::f(5);
  return 0;
}
Aaron
  • 594
  • 2
  • 12

0 Answers0