substitue for LISTS and TUPLEs in C++

Roy Smith roy at
Fri Jun 17 05:50:26 CEST 2005

"GujuBoy" <dirgesh at> wrote:
> I am trying to transfer some code from PYTHON to C++. What is the best
> substitute for a LIST and TUPLE in C++.

Depending on exactly what operations you plan to do with it, the Python 
list will translate into some kind of STL sequence container like vector. 

Tuples in Python are sometimes used like ummutable lists, in which case 
they'll also translate into STL vectors.  Sometimes tuples are used as 
anonymous fixed-length heterogeneous data structures, in which case they'll 
translate to a C++ struct.

More information about the Python-list mailing list