Sorry, I should have mentioned this, but creating a copy of the range into a newly allocated array is absolutely not acceptable (this operation should require zero memory overhead). For reference, this is trivially achievable in C++: std::reverse(R.begin(), std::find_if(R.begin(), R.end(), pred));