1 #ifndef SimTK_SimTKCOMMON_ITERATOR_RANGE_H_ 2 #define SimTK_SimTKCOMMON_ITERATOR_RANGE_H_ 57 template <
class Iterator>
63 : m_first(first), m_last(last) {}
65 : m_first(range.first), m_last(range.second) {}
66 Iterator
begin()
const {
return m_first; }
67 Iterator
end()
const {
return m_last; }
69 const Iterator m_first;
70 const Iterator m_last;
78 template <
class Iterator>
86 template <
class Iterator>
88 const std::pair<Iterator, Iterator>& range) {
94 #endif // SimTK_SimTKCOMMON_ITERATOR_RANGE_H_ Iterator begin() const
Definition: IteratorRange.h:66
This is the top-level SimTK namespace into which all SimTK names are placed to avoid collision with o...
Definition: Assembler.h:37
IteratorRange< Iterator > makeIteratorRange(const std::pair< Iterator, Iterator > &range)
Make an IteratorRange object to be used in a range-based for loop, using an std::pair of iterators...
Definition: IteratorRange.h:87
IteratorRange(Iterator first, Iterator last)
This constructor allows you to iterate over the range [first, last); this means last won't be reached...
Definition: IteratorRange.h:62
Iterator end() const
Definition: IteratorRange.h:67
Helper class to use range-based for loops with a pair of iterators.
Definition: IteratorRange.h:58
IteratorRange(const std::pair< Iterator, Iterator > &range)
Definition: IteratorRange.h:64
IteratorRange< Iterator > makeIteratorRange(Iterator first, Iterator last)
Make an IteratorRange object to be used in a range-based for loop, using two iterators.
Definition: IteratorRange.h:79