37 lines
561 B
C++
37 lines
561 B
C++
#pragma once
|
|
class IntVector
|
|
{
|
|
private:
|
|
/*size_t curr_idx = 0;
|
|
int* intVector = nullptr;*/
|
|
|
|
public:
|
|
|
|
|
|
/*size_t size() const {
|
|
return this->curr_idx;
|
|
};
|
|
|
|
int& operator[](const size_t index) {
|
|
if (index >= this->curr_idx)
|
|
throw std::invalid_argument("Index must be less than vector's size");
|
|
return this->intVector[index];
|
|
};
|
|
|
|
IntVector() = default;
|
|
|
|
~IntVector() {
|
|
delete[] intVector;
|
|
};*/
|
|
|
|
/*IntVector(const IntVector& anotherVector) {
|
|
delete[] intVector;
|
|
this->curr_idx = anotherVector.size();
|
|
|
|
intVector = new int[255];
|
|
}*/
|
|
|
|
|
|
};
|
|
|