本文整理汇总了C++中Comparator::ShowMatches方法的典型用法代码示例。如果您正苦于以下问题:C++ Comparator::ShowMatches方法的具体用法?C++ Comparator::ShowMatches怎么用?C++ Comparator::ShowMatches使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Comparator
的用法示例。
在下文中一共展示了Comparator::ShowMatches方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: clock
int main(int ac, char** av)
{
// checking args
if (ac != 3)
{
std::cerr << "Usage: " << av[0] << " <file1> <file2>" << std::endl;
std::cerr << "<file1>: list of hashes" << std::endl;
std::cerr << "<file2>: list of words" << std::endl;
return -1;
}
// getting datas
Parser parser;
std::string file1 = av[1], file2 = av[2];
std::vector<std::string>& hashes = parser.GetLines(file1);
std::vector<std::string>& words = parser.GetLines(file2);
// get matches with time
Comparator comparator;
clock_t begin, end;
begin = clock();
comparator.ShowMatches(hashes, words);
end = clock();
double elapsed = double(end - begin) / CLOCKS_PER_SEC;
std::cout.precision(5);
std::cout << "time elapsed: " << elapsed << " second(s)" << std::endl;
// cleaning
hashes.clear();
delete &hashes;
words.clear();
delete &words;
return 0;
}