2 // { dg-do compile { target c++14 } }
4 template<typename T> class vectorIterator;
6 template<typename T> class vector {
8 auto get(unsigned int i) { return data[i]; }
10 auto begin() { return vectorIterator<T>{*this, 0}; }
11 auto end() { return vectorIterator<T>{*this, 10}; }
17 template<typename T> class vectorIterator {
19 vectorIterator(vector<T>& self, unsigned int offset) : self(self), offset(offset) {}
21 auto operator*() -> T& { return self.get(offset); }
22 auto operator!=(const vectorIterator& source) -> bool { return offset != source.offset; }
23 auto operator++() -> vectorIterator& { ++offset; return *this; }
32 template<typename T> auto cast() -> T {
37 class Group : public Object {
39 template<typename T = Object> auto objects() const -> void {
40 vector<Object> easyObjects;
41 for(auto obj : easyObjects) {
42 auto casted = obj.cast<T>();
47 int main() { return 0; }