Sort a vector by specific member C++ : <p>Is it possible to sort a <code>vector</code> by a specific member of it's class? </p>

<p>I have a class called <code>Car</code>:</p>

<pre><code>class Carro {
private:
    int positionX;  
    int place;  

public:
    Carro(string marca, float energiaInicial, float energiaMaxima, int velocMax, string model = "modelo base");
    ~Carro();

    void setPosition(int posX);
    void setPlace(int place);

    int getPositionX() const;
    int getPlace() const;};
</code></pre>

<p>And a vector of cars: <code>vector&lt;Car*&gt; raceTrack;</code></p>

<p>What I want to do is sort this vector according to car's position. If the car A is ahead of car B then A takes 1st place and B takes 2nd place, and so on.</p>

<p>P.S. Imagine that all the cars have already a place defined (ex: car A has 1, car B has 2, car C has 3...)</p>
