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:
@@ -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__
|
||||
|
||||
Reference in New Issue
Block a user