]>
git.saurik.com Git - wxWidgets.git/blob - interface/vector.h
1 /////////////////////////////////////////////////////////////////////////////
3 // Purpose: interface of wxVector<T>
4 // Author: wxWidgets team
6 // Licence: wxWindows license
7 /////////////////////////////////////////////////////////////////////////////
13 wxVectorT is a template class which implements most of the std::vector
14 class and can be used like it. If wxWidgets is compiled in STL mode,
15 wxVector will just be a typedef to std::vector. Just like for std::vector,
16 objects stored in wxVectorT need to be @e assignable but don't have to
17 be @e default constructible.
19 You can refer to the STL documentation for further information.
24 @see @ref overview_wxcontaineroverview, wxListT(), wxArrayT()
34 wxVectorT(const wxVector
<T
>& c
);
44 Returns item at position @e idx.
46 const value_type
at(size_type idx
);
47 const value_type
at(size_type idx
);
54 const value_type
back();
55 const value_type
back();
60 Return iterator to beginning of the vector.
62 const_iterator
begin();
63 const iterator
begin();
69 size_type
capacity() const;
77 Returns @true if the vector is empty.
83 Returns iterator to the end of the vector.
91 Erase items. When using values other than built-in integrals
92 or classes with reference counting this can be an inefficient
95 iterator
erase(iterator it
);
96 iterator
erase(iterator first
, iterator last
);
103 const value_type
front();
104 const value_type
front();
109 Insert an item. When using values other than built-in integrals
110 or classes with reference counting this can be an inefficient
113 iterator
insert(iterator it
);
118 wxVectorT
& operator operator=(const wxVector
<T
>& vb
);
122 Returns item at position @e idx.
124 const value_type
operator[](size_type idx
);
125 const value_type
operator[](size_type idx
);
129 Removes the last item.
134 Adds an item to the end of the vector.
136 void push_back(const value_type
& v
);
139 Reserves more memory of @a n is greater then
140 wxVector::size. Other this call has
143 void reserve(size_type n
);