Skip to Content.
Sympa Menu

cgal-discuss - Re: [cgal-discuss] sort/unique for 3D point list

Subject: CGAL users discussion list

List archive

Re: [cgal-discuss] sort/unique for 3D point list


Chronological Thread 
  • From: "Sebastien Loriot (GeometryFactory)" <>
  • To:
  • Subject: Re: [cgal-discuss] sort/unique for 3D point list
  • Date: Tue, 18 May 2010 09:03:54 +0200

Sebastien Loriot (GeometryFactory) wrote:

wrote:
Hi,
I have no match calling the functions sort and unique for a list of 3D
points (I tried the comparison function K::Less_xyz_3 for sort). Could
you provide me any suggestion?
Thank you in advance!


Hello,

The sort algorithm requires random access iterators.
Try with a vector instead of a list.

std::vector<Point_3> vect;
std::sort(vect.begin(),vect.end());

S.

Andreas makes me notice that you may be talking about the sort/unique
member functions of std::list. In that case you can directly use the
function sort() and unique() as operator< are defined for points.

std::list<Point_3> lst;
lst.sort();
lst.unique();

S.



Archive powered by MHonArc 2.6.16.

Top of Page