I've printed out the results of the sort function and it appears to be grabbing the Z values of the 2 instances it's comparing properly. It also evaluates correctly if the first instance ("a")'s Z value is less than the second instance ("b"). It just doesn't appear to be sorting the vector at all based on the return data. hmmm
Let's take a look at the assignment operator=. Show us the particle class. Perhaps it cannot be copied properly. It is better to post a complete, compilable example. All that we need to see is the complete particle class, predicate, and a simple main function that inserts some values into the vector and then sorts it. This should be a really simple problem to diagnose but we cannot do that without seeing a complete example. I'm betting that the problem is that your objects aren't being copied properly.
*chrm*.... .... And if you run into an uncommon cave-eat and solved it, it's usually nice to tell the others what caused the problem and what was your solution. You know.. for all those people coming with the same problem from google via "c++ sort doesn't work" or something like that ;-)