I came across yet another place where I needed insert and remove in a vector, so I wrote them as discussed with Maciej previously.
Created attachment 6591 [details] implementation of insert and remove
Comment on attachment 6591 [details] implementation of insert and remove The ASSERT in remove() should be <, not <=. Other than that, r=me.