no one talking about the elephant? Why are you instantiating a raw array of QList? Which voice in your head thought that was a good idea?
no one talking about the elephant? Why are you instantiating a raw array of QList? Which voice in your head thought that was a good idea?
If you have a problem, CUT and PASTE your code. Do not retype or simplify it. Give a COMPLETE and COMPILABLE example of your problem. Otherwise we are all guessing the problem from a fabrication where relevant details are often missing.
I thought it better to tackle things one step at a time. On the other hand, there's nothing basically wrong with declaring an array of QList<>. It will simply consist of an array of size MAX_CLIENTS of empty QList<> allocated on the stack. Nothing magic about that, and nothing that requires use of QVector< QList< PendingMsg > > or some other fancier data structure. Each QList<> in the array can be manipulated as if it were a standalone QList<>.no one talking about the elephant?
I am not sure about the copy semantics, though. I am not sure if accessing "list[i]" results in the return of a copy or of a reference. If it is a copy, then that would be pretty inefficient.
Bookmarks