我自己定义了一个模板类:
...
template <class VType>
class CVLine
{
protected:
VType m_X1;
VType m_Y1;
VType m_X2;
VType m_Y2;
public:
CVLine();
CVLine(VType X1, VType Y1, VType X2, VType Y2);
VType GetLineLength();
void SetPts(const VType& X1, const VType& Y1, const VType& X2,
const VType& Y2);
...
};
...
然后,我在引用他的地方定义如下vector 或 list
...
std::vector<CVLine<int>> IntPtsVector;
or
std::list<CVLine<int>> IntPtsList;
均有错误,但单独使用VLine<int>则没错,请问各位高人,C++是否允许上述用法?该怎么用?
std::vector<CVLine<int> > IntPtsVector;
std::list<CVLine<int> > IntPtsList;
连续两个>>会让编译器认为是移位操作而导致编译失败