0

I have a template class as below

template<typename T>
class HMM{
    private:
        int states_num;
        int observables_num;
        std::vector<std::vector<T>> t_probs( states_num, std::vector<T>(states_num, T{}) );
    public:
        HMM(int s, int o):states_num(s),observables_num(o){}

    };

But I am getting an compilation error error: ‘states_num’ is not a type, here states_num is an int, not a type depending on T, why I am getting this error?

Allanqunzi
  • 3,230
  • 1
  • 26
  • 58
  • `t_probs` looks like you are trying to declare a member function, but the declaration doesn't make any sense. You probably meant to use braces, not parentheses, so that `t_probs` is a data member, brace-initialized. – Igor Tandetnik Oct 16 '15 at 04:28
  • @IgorTandetnik, I think you are right, thanks. – Allanqunzi Oct 16 '15 at 04:29

0 Answers0