I have this bit of code, which was working, I changed something in another part of code and recompiled and now all of a sudden I'm getting "you cannot assign variable that is const".
This is because in class Obj your members are all private by default (in contrast to structs) and thus you cannot access them in funct_sort_obj.
Insert public and it will work. Even better, you can provide const getter functions and change the signature to int funct_sort_obj(const Obj* lhs, const Obj* rhs).
The problem isn't the getter functions, it's when it tries to change the value (since this is a sort method) so the error is when the sort() function tries assigning a value to the iterator:
*_First = *_Next;
I have a backup of my source code where it works fine, for some reason it decided to start using the const overloaded function of begin(). There isn't anything forcing it to be const and there isn't anything forcing it not to be, I guess there is some sort of error for Microsoft's compiler as the error only started happening when I created a for loop using iterators.
edit:
error C2440: 'initializing' : cannot convert from 'std::_Vector_const_iterator<_Ty,_Alloc>' to 'std::_Vector_iterator<_Ty,_Alloc>'
Get that error using above code, I'll try a different compiler...
This sounds really like a const-correctness problem. Is it possible that your objs variable is somewhere passed as const into some subroutine? In this case you would always get const iterators from that vector. You can provide more code if you want.