OutputType sub_container(InputIterator first, InputIterator last, OutputType &local_ctn, OutputIterator local_ctn_begin, const ElemType &val, Comp pred) { copy(first, last, local_ctn_begin); sort(first, last, not2(pred)); OutputIterator iter = find_if(local_ctn_begin, local_ctn.end(), bind2nd(pred, val)); local_ctn.erase(iter, local_ctn.end()); return local_ctn; };