diff options
Diffstat (limited to 'g_src/svector.h')
-rwxr-xr-x | g_src/svector.h | 28 |
1 files changed, 28 insertions, 0 deletions
diff --git a/g_src/svector.h b/g_src/svector.h new file mode 100755 index 0000000..3d9e81a --- /dev/null +++ b/g_src/svector.h @@ -0,0 +1,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 |