M
m0shbear
Suppose I have the following:
foo.h--
template <class T>
class Foo {
T bar(const T&);
};
foo.cpp--
#include "foo.h"
int Foo<int>::bar(const int& x) {
....
return ...;
}
The compile fails with " error: too few template-parameter-lists" (g++
4.5).
Is there a correct way to properly specialize such member functions?
As there is a small, finite set of T to be used, I want to specialize
for all T.
foo.h--
template <class T>
class Foo {
T bar(const T&);
};
foo.cpp--
#include "foo.h"
int Foo<int>::bar(const int& x) {
....
return ...;
}
The compile fails with " error: too few template-parameter-lists" (g++
4.5).
Is there a correct way to properly specialize such member functions?
As there is a small, finite set of T to be used, I want to specialize
for all T.