J
Joseph Turian
I have a class Feature defined, which is a kind of Vocab:
template <class T, unsigned I>
class Vocab : boost::totally_ordered<Vocab<T,I> > {
public:
Vocab();
Vocab(const T& t);
template<typename V> Vocab(V v, bool dummy);
....
};
typedef Vocab<string, 0> Feature;
Then, I try to specialize (define?) the templated constructor:
template<>
inline Feature::Vocab(pair<parser::id_ty, string> p, bool dummy) {
...
}
This code compiles under g++ 3.4, but under g++ 4 I get the following
errors:
src/specialize-bdt.H:37: error: template-id 'Vocab<>' for
'bdt::Vocab<std::string, 0u>::Vocab(std:air<parser::id_ty,
std::string>, bool)' does not match any template declaration
src/specialize-bdt.H:37: error: invalid function declaration
What is the problem here?
Thanks,
Joseph
template <class T, unsigned I>
class Vocab : boost::totally_ordered<Vocab<T,I> > {
public:
Vocab();
Vocab(const T& t);
template<typename V> Vocab(V v, bool dummy);
....
};
typedef Vocab<string, 0> Feature;
Then, I try to specialize (define?) the templated constructor:
template<>
inline Feature::Vocab(pair<parser::id_ty, string> p, bool dummy) {
...
}
This code compiles under g++ 3.4, but under g++ 4 I get the following
errors:
src/specialize-bdt.H:37: error: template-id 'Vocab<>' for
'bdt::Vocab<std::string, 0u>::Vocab(std:air<parser::id_ty,
std::string>, bool)' does not match any template declaration
src/specialize-bdt.H:37: error: invalid function declaration
What is the problem here?
Thanks,
Joseph