ex02: fix: add include fix syntax
This commit is contained in:
parent
066d646cf5
commit
90b510cf0c
@ -1,5 +1,8 @@
|
||||
#pragma once
|
||||
|
||||
#include <cstddef>
|
||||
#include <exception>
|
||||
|
||||
template<typename T>
|
||||
class Array
|
||||
{
|
||||
@ -33,15 +36,15 @@ class Array
|
||||
return ;
|
||||
delete[] this->_arr;
|
||||
this->_size = src._size;
|
||||
new this->_arr[src._size];
|
||||
new T[src._size];
|
||||
for (size_t i = 0; i < src._size; i++)
|
||||
this->_arr[i] = src._arr[i];
|
||||
};
|
||||
Array& operator[](unsigned int index)
|
||||
{
|
||||
if (i >= _size)
|
||||
if (index >= _size)
|
||||
throw std::exception();
|
||||
return _array[i];
|
||||
return _arr[index];
|
||||
};
|
||||
|
||||
unsigned int size() const
|
||||
|
Loading…
Reference in New Issue
Block a user