可能重複:
For nested templates, when did `>>` become standard C++ (instead of `> >`)?
Why did templates of templates (e.g. vector<vector<int> >) require a space between the closing angle brackets prior to C++0x?模板問題與向量
我只是想創建一個向量:
vector<Transform3D<double>> tempVector;
這是編譯錯誤我得到:
/../main.cpp:34:26: error: a space is required between consecutive right angle brackets
(use '> >')
vector<Transform3D<double>> tempVector;
^~
> >
什麼不做的道理是,爲什麼這個問題是通過改變向量作爲錯誤描述解決:
vector<Transform3D<double > > tempVector;
爲什麼vector<Transform3D<double>>
和vector<Transform3D<double > >
不相同?
在使用C++ 11之前,'>>'可能會將編譯器混淆爲'>>'操作符。 – birryree