1 // Test for range-based for loop
2 // Test the loop with a custom iterator
3 // with begin/end as member functions
5 // { dg-do compile { target c++11 } }
10 explicit iterator(int v) :x(v) {}
11 iterator &operator ++() { ++x; return *this; }
12 int operator *() { return x; }
13 bool operator != (const iterator &o) { return x != o.x; }
21 container(int a, int b) :min(a), max(b) {}
29 return iterator(max + 1);
36 foo::container c(1,4);