92 RandomAccessIterator first, RandomAccessIterator last) {
93 if (first == last) {
return false; }
95 RandomAccessIterator endIter = --last;
96 typename std::vector<RandomAccessIterator>::iterator i =
99 if (iterContainer.empty()) {
101 iterContainer.insert(iterContainer.end(), first);
103 }
else if (*(--i) != endIter) {
119 typename std::vector<RandomAccessIterator>::iterator j = i;
121 while (j >= iterContainer.begin() && *i == *j + 1) {
126 RandomAccessIterator raIter;
127 if (j - iterContainer.begin() <
130 if (last - first + 1 ==
int(iterContainer.size())) {
136 for (i = iterContainer.begin(), raIter = first;
137 i != iterContainer.end(); ++i, ++raIter) {
140 iterContainer.insert(iterContainer.end(), raIter);
148 for (; i != iterContainer.end(); ++i) {
bool next_combination(std::vector< RandomAccessIterator > &iterContainer, RandomAccessIterator first, RandomAccessIterator last)
STL next_permuation-like combination sequence generator.