c130123853585dbaaf9ccd0f6ab2943fa1e060d1
[tpg/acess2.git] / Usermode / Libraries / libc++.so_src / include_exp / vector
1 /*
2  * Acess2 C++ Library
3  * - By John Hodge (thePowersGang)
4  *
5  * string (header)
6  * - C++'s String type
7  */
8 #ifndef _LIBCXX_VECTOR_
9 #define _LIBCXX_VECTOR_
10
11 #include <allocator>
12
13 namespace std {
14
15 namespace _bits {
16 template <class T> class vector_iterator;
17 }
18
19 template <class T, class Alloc = allocator<T> >
20 class vector
21 {
22 public:
23         typedef T       value_type;
24         typedef Alloc   allocator_type;
25         typedef typename allocator_type::reference      reference;
26         typedef typename allocator_type::const_reference        const_reference;
27         typedef typename allocator_type::pointer        pointer;
28         typedef typename allocator_type::const_pointer  const_pointer;
29         typedef ::std::_bits::vector_iterator<T>        iterator;
30         typedef ::std::_bits::vector_iterator<const T>  const_iterator;
31         typedef int     difference_type;
32         typedef size_t  size_type;
33
34 private:
35         allocator_type  m_alloc;
36         size_type       m_size;
37         size_type       m_capacity;
38         value_type*     m_data;
39
40 public: 
41         vector(const allocator_type& alloc = allocator_type()):
42                 m_alloc(alloc),
43                 m_size(0),
44                 m_capacity(0),
45                 m_data(0)
46         {
47         }
48         vector(size_type n, const value_type& val = value_type(), const allocator_type& alloc = allocator_type()):
49                 vector(alloc)
50         {
51                 
52         }
53         vector(const vector& x):
54                 vector(x.m_alloc)
55         {
56                 *this = x;
57         }
58         
59         ~vector()
60         {
61                 for( size_type i = 0; i < m_size; i ++ ) {
62                         m_alloc.destroy( &m_data[i] );
63                 }
64         }
65         
66         
67 };
68
69 };      // namespace std
70
71 #endif
72 // vim: ft=cpp
73

UCC git Repository :: git.ucc.asn.au