mardi 23 mai 2017

Iterating over nested structures

Here is a part of implementation of a List

template <typename T>
struct Box
{
T info;
Box<T>* link;
 };
 template <typename T>
class List{
public: 
  //...
private:
        Box<T> *start,*end;

It is easy to iterate through an object for example List < int > list1 ,but how should I iterate over

List < List < int > > mylist ,is there any method?

Aucun commentaire:

Enregistrer un commentaire