Remove indicies from vector
There are a few things I would improve:

Clearly separate the three distinct phases:

Skip until the first index in the set
Copy/delete until we reached the last index
Copy the remainder until the end of the container is reached.


Have an outer loop that loops over the entries of set.
Use *foo++ syntax.
Use auto return type deduction.
Name things after their purpose, not what type they are. So instead of set, name it indices.

With this, the code would look like:
template &lt;class T, class IdxT&gt; 
auto remove_indices(std::vector&lt;T&gt;&amp; container, const std::set&lt;IdxT&gt;&amp; indices)
{
    // Exit early if there is nothing to do.
    if (indices.empty())
        return container.end();

    auto destination = container.begin();
    auto source = container.begin();
    auto idx_it = indices.begin();

    // Skip until we reach the first index.
    std::advance(destination, *idx_it);
    std::advance(source, *idx_it + 1);

    // Delete all the elements at the given indices.
    while(++idx_it != indices.end()) {
        auto nextDelete = container.begin() + *idx_it;
        while(source &lt; nextDelete)
            *destination++ = std::move(*source++);
        source++;
    }

    // Copy the remainder until the end of the container.
    while (source != container.end())
        *destination++ = std::move(*source++);

    return destination;
}

Also consider adding a test suite. And you might want to generalize this further to remove elements from other random access container types (for example, std::deque), and have it take the indices in other container types as well, as a std::set is quite an inefficient way to store a few integers.