Skip to content

Latest commit

 

History

History
104 lines (63 loc) · 2.35 KB

CppNestedTemplateCloser.md

File metadata and controls

104 lines (63 loc) · 2.35 KB

 

 

 

 

 

 

When template data types are nested, for example a std::vector of std::vectors of int, its declaration ends with its nested template closer.

 

The nested template closer depends on the standard used:

 

 

 

 

 

 

The nested template closer must be '> >', instead of just '>>'.

 


#include <vector> int main() {   std::vector<std::vector<int> > v; }

 

 

 

 

 

 

 

The nested template closer can be '>>'.

 


#include <vector> int main() {   std::vector<std::vector<int>> v; }

 

Technical note: this code is compiled successfully using the G++ 4.4.5 compiler, which is supplied with the Qt Creator 2.0.0 IDE.