C++ : Vector of template class

后端 未结 4 1890
灰色年华
灰色年华 2020-12-10 04:39

I have a template class named Cell as follows:-

templateclass Cell
{
    string header, T data;
}

Now I want another class N

4条回答
  •  失恋的感觉
    2020-12-10 05:31

    The other answer is good, but you probably wanted:

    template
    class Row
    {
    private:
        class Cell {
            string header;
            T data;
        }
    
        std::vector cells;
        ...
    }
    

提交回复
热议问题