It's possible, but strings are sorted lexicographically by default. You need a custom comparison functor.
For simplicity, I'm assuming the space above is not there. You'll have to do that adaption yourself.
Code:
struct rcompare_sortkey
{
bool operator()(const std::string &lhs, const std::string &rhs {
std::string::size_type lp = lhs.find(","), rp = rhs.find(",");
return boost::lexical_cast<int>(lhs.substring(0, lp))
> boost::lexical_cast<int>(rhs.substring(0, rp));
}
};
std::sort(Numbers.begin(), Numbers.end(), rcompare_sortkey());
Note that the functor is a greater-than, so you can use the normal iterators.