#include <algorithm>
#include <functional>
#include <iostream>
#include <vector>

template <class T, typename P = std::less<typename T::value_type>>
void dropsort(T& cont, P pred = P())
{
    cont.erase(std::unique(cont.begin(), cont.end(), std::not2(pred)),
               cont.end()
              );
}

int main( )
{
    std::vector<int> arr = {0, 2, 1, 4, 3, 6, 5, 7, 9, 8};
    dropsort(arr);
    std::cout << std::is_sorted(arr.begin(), arr.end());
}
