Does the standard guarantee that order of equal elements will not change (eh, forgot the term for that) by using std::sort or do I need to consider an alternative solution
The term for what you're describing is stability.
From SGI's STL docs:
Note: sort is not guaranteed to be stable.
sort
Use stable_sort if you need this.