2014-06-30 01:57:50 -07:00
|
|
|
import io;
|
2014-07-23 02:23:21 -07:00
|
|
|
import mem;
|
2014-06-30 01:57:50 -07:00
|
|
|
import vector;
|
|
|
|
|
|
2014-07-23 02:23:21 -07:00
|
|
|
typedef AbleToBeDestroyed (Destructable) {
|
2014-07-06 23:42:25 -07:00
|
|
|
void destruct() {
|
|
|
|
|
println("Destroyed!");
|
|
|
|
|
}
|
|
|
|
|
};
|
|
|
|
|
|
2014-06-30 01:57:50 -07:00
|
|
|
int main() {
|
2014-07-28 01:52:15 -07:00
|
|
|
vector<int> intVec.construct();
|
2014-07-23 02:23:21 -07:00
|
|
|
intVec.addEnd(1);
|
|
|
|
|
intVec.addEnd(3);
|
|
|
|
|
intVec.addEnd(3);
|
|
|
|
|
intVec.addEnd(7);
|
2014-07-28 01:52:15 -07:00
|
|
|
for (int i = 0; i < intVec.size; i++;)
|
2014-06-30 01:57:50 -07:00
|
|
|
print(intVec.at(i));
|
|
|
|
|
|
|
|
|
|
println();
|
2014-07-06 23:42:25 -07:00
|
|
|
|
2014-07-28 01:52:15 -07:00
|
|
|
vector<AbleToBeDestroyed>* desVec = new<vector<AbleToBeDestroyed>>()->construct();
|
2014-07-23 02:23:21 -07:00
|
|
|
AbleToBeDestroyed testDestruct;
|
|
|
|
|
desVec->addEnd(testDestruct);
|
|
|
|
|
delete<vector<AbleToBeDestroyed>>(desVec);
|
2014-07-06 23:42:25 -07:00
|
|
|
|
2014-06-30 01:57:50 -07:00
|
|
|
return 0;
|
|
|
|
|
}
|