sorting vector with 3D points by a coordinate value -- syntax
<p>I want to sort points_vec  vector as shown in the pseudocode below. I want to sort this vector, by a coordinate value like x or y or z</p>

<pre><code>class A{

  std:vector&lt;double*&gt; points_vec;

  void doSomething();

}
</code></pre>

<p>Then, in method <code>A::doSomething,</code> I want sort this vector: </p>

<pre><code>void A::doSomething() {
    std::sort(points_vec.begin(), points_vec.end(), sortPoints());
}
</code></pre>

<p>Can someone please show me syntax for the <code>sortPoints()</code> method.. Preferably I want it to be a method of class A. <a href="http://stackoverflow.com/questions/890371/how-to-sort-an-object-stdvector-by-its-float-value">this post</a> creates a <code>struct</code> to do this, not sure if I should create a similar <code>struct</code> within the class. Is there another way to handle this?</p>

<p>thanks</p>
