#include <iostream>
#include <deque>
#include <algorithm>
using std::deque;
using std::cout;
using std::endl;
void print(int element)
{
cout << element << ' ';
}
int main()
{
deque<int> dq = { 1, 3, 8, 23, 88, 12, 99, 7 };
deque<int>::const_iterator pos1, pos2;
pos1 = find(dq.cbegin(), dq.cend(), 8);
pos2 = find(dq.cbegin(), dq.cend(), 12);
for_each(pos1, pos2 + 1, print);
cout << endl;
}
/*
run:
8 23 88 12
*/