~jlukas79/+junk/mysql-server

« back to all changes in this revision

Viewing changes to sql/sql_array.h

manual merge 6.0-main --> 6.0-bka-review

Show diffs side-by-side

added added

removed removed

Lines of Context:
21
21
 
22
22
template <class Elem> class Dynamic_array
23
23
{
 
24
protected:
24
25
  DYNAMIC_ARRAY  array;
25
26
public:
26
27
  Dynamic_array(uint prealloc=16, uint increment=16)
33
34
    my_init_dynamic_array(&array, sizeof(Elem), prealloc, increment);
34
35
  }
35
36
 
36
 
  Elem& at(int idx)
 
37
  Elem& at(ulong idx) const
37
38
  {
38
39
    return *(((Elem*)array.buffer) + idx);
39
40
  }
40
41
 
41
 
  Elem *front()
 
42
  Elem *front() const
42
43
  {
43
44
    return (Elem*)array.buffer;
44
45
  }
45
46
 
46
 
  Elem *back()
 
47
  Elem *back() const
47
48
  {
48
49
    return ((Elem*)array.buffer) + array.elements;
49
50
  }
53
54
    return (insert_dynamic(&array, (uchar*)&el));
54
55
  }
55
56
 
56
 
  int elements()
 
57
  ulong elements() const
57
58
  {
58
59
    return array.elements;
59
60
  }