I am developing my own implementation of the vector class from stl. When I tried to execute my code, I found an error not just a syntax error where it says on which line the error occurred, but another error related to the project build error. It does not even say where exactly the error is, and visual studio does not emphasize the error. Help please.
using namespace std;
template<typename T>
class vector
{
using uint = unsigned int;
T* arr;
uint size;
public:
vector(uint _Newcapacity)
{
arr = new vector<T>[_Newcapacity];
}
~vector()
{
delete[] arr;
}
};
int main()
{
vector<int> _v(5);
}
I experimented and realized that there was a mistake in the constructor, but I didn’t understand why, in my opinion, is it still true or not?
Error: There were build errors. Continue and run the last
successfully built version?
enter image description here
22