// ((++currentEntry)--) is equivalent to (currentEntry + 1). Kind of.
menuEntries.insert((++currentEntry)--, newEntries.begin(), newEntries.end());
So I have the world’s worst piece of code here. Is there a better way to do this?
When using ‘+ 1’ I get this:
source/menu.cpp:146:37: error: invalid operands to binary expression
('list<menuEntry *>::iterator' (aka '_List_iterator<menuEntry *>') and
'int')
menuEntries.insert(currentEntry + 1, ...
~~~~~~~~~~~~ ^ ~
Why not split into multiple lines:
where
iteratoris iterator type for the list. Personally, I would probably pull the++nextEntryonto its own line for further clarity – but that is probably a subjective decision.