mercredi 30 mai 2018

How would I use initializer list to directy create my linked list?

I wrote a linked list in the template format.

Now what I would like to do is this:

mylib::list<int> x = {2,3,4,5}

Where mylib is the namespace, and what I would like to do is create a constructor or overload assignment operator to do this. I read here Initializer list for dynamic array and overloading assignment operators

I cannot possibly think a way of how to this.

Aucun commentaire:

Enregistrer un commentaire