Delete the node at index i from its current position and insert it after node at index j
This looks quite sane, is there a reason you do not work with iterators? 


your assert doesnt use the reference but a copy, so you should use const std::initializer_list&lt;int&gt; &amp;indices
In the equal case, i would make it actually explicit and do std::swap(nodes[i], nodes[i + 1]), which is the same pattern you used all over the code.
It might be ok if your assert is used multiple times, but it is rather confusing, that you pass it i and j and i read only i in the code. Maybe use better names like index1 index2
Any reason you declare x outside of the loops?