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