summaryrefslogtreecommitdiff
path: root/tests/run/cpp_iterators_simple.h
blob: 8373237d87b394e0cd0e2b6332a73d5fd320fb1b (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
class DoublePointerIter {
public:
    DoublePointerIter(double* start, int len) : start_(start), len_(len) { }
    double* begin() { return start_; }
    double* end() { return start_ + len_; }
private:
    double* start_;
    int len_;
};

class DoublePointerIterDefaultConstructible: public DoublePointerIter {
    // an alternate version that is default-constructible
public:
    DoublePointerIterDefaultConstructible() :
        DoublePointerIter(0, 0)
    {}
    DoublePointerIterDefaultConstructible(double* start, int len) :
        DoublePointerIter(start, len)
    {}

};