substitue for LISTS and TUPLEs in C++

G

GujuBoy

I am trying to transfer some code from PYTHON to C++. What is the best
substitute for a LIST and TUPLE in C++.

please advice.
 
R

Roy Smith

GujuBoy said:
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.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
474,434
Messages
2,571,690
Members
48,796
Latest member
Greg L.

Latest Threads

Top