summaryrefslogtreecommitdiff
path: root/g_src/svector.h
blob: 3d9e81a7934b2c796113f138a4e9bc37f980eff7 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
//pelican aka sam dennis wrote this
#ifndef SVECTOR_H
#define SVECTOR_H

#include <vector>
#include <memory>

template <class T, class A = std::allocator<T> >
class svector : public std::vector<T, A> {
#ifndef WIN32
        public:
		using std::vector<T, A>::begin;
#endif

#ifdef WIN32
        public:
#endif
                void erase(typename std::vector<T, A>::size_type i) {
                        std::vector<T, A> &vec = *this;
                        vec.erase(begin() + i);
                }
                void insert(typename std::vector<T, A>::size_type i, const T &v) {

                        std::vector<T, A> &vec = *this;
                        vec.insert(begin() + i, v);
                }
};
#endif