1. boost::unordered_set(优势:查找非常方便)
#include <iostream>
#include<boost/unordered_set.hpp>
#include<string>
using namespace std;
void main()
{
boost::unordered_set<std::string> myhashset;
myhashset.insert("ABC");
myhashset.insert("ABCA");
myhashset.insert("ABCAG");
for (auto ib = myhashset.begin(); ib != myhashset.end();ib++)
{
cout << *ib << endl;
}
std::cout << (myhashset.find("ABCA1") != myhashset.end()) << endl;
cin.get();
}
运行结果: