diff --git a/random-access-containers/vector.hpp b/random-access-containers/vector.hpp index 4169c8f..5d106bf 100644 --- a/random-access-containers/vector.hpp +++ b/random-access-containers/vector.hpp @@ -1,4 +1,3 @@ -#include #include #include @@ -12,7 +11,7 @@ protected: public: void Resize(std::size_t const newSize) { - void * result = std::realloc(data, newSize); + void * result = std::realloc(data, newSize * sizeof(T)); if(result == nullptr) { throw std::runtime_error("Cannot allocate the requested size of memory.");