56 std::vector<std::vector<std::string>::iterator>& cont,
57 std::vector<std::string>& sequence, std::vector<std::string>& result,
58 const std::string& wildCard) {
59 if (cont.size() > sequence.size()) {
60 std::cerr <<
"the size of iterator container is greater than the size of "
64 bool hasMoreCombination =
66 if (hasMoreCombination) {
68 result.insert(result.begin(), sequence.size(), wildCard);
69 std::vector<std::vector<std::string>::iterator>::iterator i;
70 for (i = cont.begin(); i != cont.end(); ++i) {
71 result[*i - sequence.begin()] = **i;
75 return hasMoreCombination;
bool replaceWithWildCard(std::vector< std::vector< std::string >::iterator > &cont, std::vector< std::string > &sequence, std::vector< std::string > &result, const std::string &wildCard)
iteratively replace the sequence with wild cards
bool next_combination(std::vector< RandomAccessIterator > &iterContainer, RandomAccessIterator first, RandomAccessIterator last)
STL next_permuation-like combination sequence generator.