add algorithm::slice_until (slice1 range from the beginning until range2 not-inclusive)

master
Daniel Kolesa 2015-08-13 23:25:39 +01:00
parent 1a6d95580f
commit 0a55b0326e
1 changed files with 5 additions and 0 deletions

View File

@ -347,6 +347,11 @@ bool equal(R range1, R range2) {
return range2.empty();
}
template<typename R>
R slice_until(R range1, R range2) {
return range1.slice(0, range1.distance_front(range2));
}
/* algos that modify ranges or work with output ranges */
template<typename R1, typename R2>