2

Is there an algorithm to find a range of values ​​in the std::list, could do such action:

list<char> text;
text.push_back('a');
text.push_back('b');
text.push_back('c');
text.push_back('d');
text.push_back('e');
text.push_back('f');

list<char> values;
values.push_back('c');
values.push_back('d');
values.push_back('e');

list<char>::iterator it = find(text.begin(), text.end(), values);
4

1 回答 1

5

你要搜索

list<char>::iterator it = search(text.begin(), text.end(),
                                 values.begin(), values.end());
于 2013-01-23T11:50:09.690 回答