0
Why not able to use initializer list
Hi Tried to create a custom class having own iterator. Why below line does not work? myClass<int> obj({ 5,7,9,11,13,15,61 }); Isn't it get binded to myClass(initializer_list<T> lstData)? What can be done to define obj from main function? https://code.sololearn.com/c52WvnTAR09H
1 Respuesta
0
Okay, so there were two errors.
1. You forgot to change lsData to m_data.
2. You have to initialized the variables in the same order as they are declared in class.
https://code.sololearn.com/chbLhpbW0TW9/?ref=app