Template Specializaton in Builder 3
Posted on 1998-08-21
I have a skeleton of a templat class A. The class has a specialization for one of its member functions (operator () specialized for char) This works fine when I compile it in VC 5 (compiles and executes appropraitely). However, when I compile it in Borland C++ Builder 3, I get the error that
[C++Error] borcon.cpp(12): Body has already been defined for function 'A<char>::operator ()(const char &) const'.
What is the correct syntax for the this specialization? Is there a syntaz that will work on both?
template<class T> class A
int operator () (const T &t) const
//int A<char>::operator () (const T &t) const
template<> int A<char>::operator () (const T &t) const
int main(int argc, char **argv)
int i = ACh('a');