1
0
mirror of https://github.com/cookiengineer/audacity synced 2026-02-22 22:21:24 +01:00

Define and use IteratorRange

This commit is contained in:
Paul Licameli
2016-08-11 13:06:39 -04:00
parent 90e400b0a7
commit 6909bdf398
3 changed files with 14 additions and 8 deletions

View File

@@ -727,4 +727,16 @@ Final_action<F> finally (F f)
return Final_action<F>(f);
}
/*
* A convenience for use with range-for
*/
template <typename Iterator>
struct IteratorRange : public std::pair<Iterator, Iterator> {
IteratorRange (Iterator &&a, Iterator &&b)
: std::pair<Iterator, Iterator> { std::move(a), std::move(b) } {}
Iterator begin() const { return this->first; }
Iterator end() const { return this->second; }
};
#endif // __AUDACITY_MEMORY_X_H__