ex02: fix: add include fix syntax

This commit is contained in:
Camille Chauvet 2023-10-04 14:12:05 +00:00
parent 066d646cf5
commit 90b510cf0c

View File

@ -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