modifications on the vector.h
This commit is contained in:
parent
07f4829a94
commit
3d23ff6168
Binary file not shown.
|
@ -1,13 +1,14 @@
|
|||
#include "shapes.h"
|
||||
#include "vector.h"
|
||||
|
||||
#include <vector>
|
||||
|
||||
int main(){
|
||||
|
||||
myspace::vector<double> a(10,5.0);
|
||||
std::cout<< a[15] << "\n";
|
||||
// myspace::vector<double> a(10,5.0);
|
||||
// std::cout<< a[0] << "\n";
|
||||
|
||||
myspace::vector<Cube> a(10,Cube());
|
||||
// myspace::vector<Cube> b(10,Cube());
|
||||
std::vector<Cube> c(10,Cube());
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
|
|
@ -29,6 +29,10 @@ vector<T>::vector(int _N, T _Val ):N(_N){
|
|||
|
||||
template <typename T>
|
||||
vector<T>::~vector(){
|
||||
for (int i{0};i < N; i++){
|
||||
delete data[i];
|
||||
std :: cout << i << "\n";
|
||||
}
|
||||
delete [] data;
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue