1 /* { dg-do compile } */
2 /* { dg-options "-O2" } */
6 template < class T > class Array
8 protected:int mindex, maxdex;
10 int InsertAt (const T & t, int n)
12 T *new_data = new T[++this->maxdex - this->mindex + 1] - this->mindex;
14 for (i = this->mindex; i <= n - 1; i++)
15 new_data[i] = this->data[i];
17 public: Array (unsigned int len = 0):mindex (1), maxdex (len),
18 data ((len) ? new T[len] -
25 delete[](data + mindex);
27 const T & operator[] (int index) const
30 int Append (const T & t)
32 return InsertAt (t, this->maxdex + 1);
38 private:Gambit::Array < int >MinIndices;
39 Gambit::Array < int >CurIndices;
40 gIndexOdometer (const Gambit::Array < int >, const Gambit::Array < int >);
41 void SetIndex (const int &, const int &);
42 int NoIndices () const;
43 gIndexOdometer AfterExcisionOf (int &) const;
46 gIndexOdometer::AfterExcisionOf (int &to_be_zapped) const
48 Gambit::Array < int >NewMins, NewMaxs;
50 for (i = 1; i <= NoIndices (); i++)
52 NewMins.Append (MinIndices[i]);
54 gIndexOdometer NewOdo (NewMins, NewMaxs);
55 NewOdo.SetIndex (i, CurIndices[i]);