-1
我不明白什么是模板类用于? 我是新来的C++。我可以得到详细的解释。模板类在C++中的用途是什么
// constructing unordered_sets
#include <iostream>
#include <string>
#include <unordered_set>
template<class T>
T cmerge (T a, T b) { T t(a); t.insert(b.begin(),b.end()); return t; }
std::unordered_set<std::string> second ({"red","green","blue"}); // init list
std::unordered_set<std::string> third ({"orange","pink","yellow"}); // init list
std::unordered_set<std::string> fourth (second);
std::unordered_set<std::string> fifth (cmerge(third,fourth)); // move
[阅读了良好的初学者两本书](https://stackoverflow.com/questions/388242/the-definitive-c-book-guide-and-list)。 –
你能建议我一些他做的 –
。这是一个链接。 – Yunnosch