Could you please tell me what is the closest data type in C++ to python list? If there is nothing similar, how would you build it in C++?
I am working on a wrapper for std::vector that makes it more like Python's lists named pylistpp. The API is just like Python. Example:
#include
#include
int main()
{
list mylist;
mylist.append(5);
mylist.append(7);
int count = mylist.count(5);
std::cout << count << std::endl;
std::cout << mylist.pop(0) << std::endl;
std::cout << mylist.index(7);
return 0;
}