#include <unordered_map>
#include <algorithm>
#include <vector>

template <class C, typename T = typename C::value_type>
std::vector<T> copy_to_vec(const C& from) {
std::vector<T> res(from.begin(),from.end());
std::sort(res.begin(),res.end());
return res;
}

int main()
{
std::unordered_map<int,int> from;
from.insert(std::make_pair(1,2));
auto to = copy_to_vec(from);
}

このコードなんですが、unordered_map::value_typeはpair<const key_type,mapped_type>
と勝手にconstが入ってしまうので、sort(...)が使えません。-fpermissibleを入れろと言ってきます。
テンプレート引数でT=...となっている部分を変えて何とかなりませんか?