Skip to content

Instantly share code, notes, and snippets.

@Zetaeta
Forked from DarTheStrange/tempy.cpp
Last active December 17, 2015 21:19
Show Gist options
  • Save Zetaeta/5673803 to your computer and use it in GitHub Desktop.
Save Zetaeta/5673803 to your computer and use it in GitHub Desktop.
#include <iostream>
using namespace std;
template<class T>
class array {
T* g = new T[8];
int size = 8;
public:
T& operator[] (int y) {
return g[y];
}
void resize(int y) {
T* temp = new T[y];
for (int i = 0; i - y && i - size; ++i){
temp[i] = g[i];
}
delete[] g;
g = temp;
size = y;
}
};
int main() {
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment