A
{AGUT2} {H}-IWIK
Guys, I have these headers:
#include <stdlib>
#include <math>
#include <iostream>
#include <iomanip>
#include <fstream>
#include <vector>
#include <string>
#include <algorithm>
*amongst others) and a a data structure:
// Creates part of basic framework of the output numbering system
struct vertexPoints {
int num;
double xc;
double yc;
double zc;
};
from this, I have created a vector
vector<vertexPoints> myPoints;
with vertices push_back()'ed onto it. I want to be able to sort this -
mainly by x, but ideally by x, then y, then z.
if I type mypoints.sort(myPoints.begin(), myPoints.end, comparex);
with
bool comparex(myPoints& x, myPoints& y)
{
return x.xc < y.xc;
}
the compiler throws a tantrum saying that sort is not a member function of
the vertex<myPoints> vector.
What am I doing wrong?
TIA,
Alex.
#include <stdlib>
#include <math>
#include <iostream>
#include <iomanip>
#include <fstream>
#include <vector>
#include <string>
#include <algorithm>
*amongst others) and a a data structure:
// Creates part of basic framework of the output numbering system
struct vertexPoints {
int num;
double xc;
double yc;
double zc;
};
from this, I have created a vector
vector<vertexPoints> myPoints;
with vertices push_back()'ed onto it. I want to be able to sort this -
mainly by x, but ideally by x, then y, then z.
if I type mypoints.sort(myPoints.begin(), myPoints.end, comparex);
with
bool comparex(myPoints& x, myPoints& y)
{
return x.xc < y.xc;
}
the compiler throws a tantrum saying that sort is not a member function of
the vertex<myPoints> vector.
What am I doing wrong?
TIA,
Alex.