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,241
Messages
2,571,223
Members
47,858
Latest member
SangC9100

Latest Threads

Top