Please specify the range of vector list ….
I want to store million of records in vector<>.
I have to copy Millions of records from one vector<> to another vector<> and then sort the vector and apply my filter function(unique id) to retrieve the record.
is this possible in vector
Regards,
Karthik
I think you have answered your own question.
Theoretical limit for your system you can get with a function
vector<T>::max_size(). For instance:So just run this and check out the answer for your system.
However in practice the vector’s allocated array must be in one consecutive memory block and even with less size memory allocation can fail. If you are going to use vector of ints with million elements I think you shouldn’t have any problems. However for bigger objects it can be problematic.