Skip to Content.
Sympa Menu

cgal-discuss - HalfedgeDS_*::Vertex_handle in std::set and std::map?

Subject: CGAL users discussion list

List archive

HalfedgeDS_*::Vertex_handle in std::set and std::map?


Chronological Thread 
  • From: Tom Bobach <>
  • To:
  • Subject: HalfedgeDS_*::Vertex_handle in std::set and std::map?
  • Date: Fri, 28 Sep 2007 09:06:11 +0200
  • Organization: University of Kaiserslautern

Dear CGAL community,

I am facing the problem that in the default halfedge data structure
implementation there is no comparison operator defined for handles and
iterators.
This makes usage of Handles in std::set and std::map unnecessarily
complicated. I am wondering if someone else faced this problem and if there
is an easy, non-intrusive way to fix this.


Thanks a lot!

Tom


As an illustration, the following won't work:

============ <CODE: main.cpp> =============

#include <CGAL/Simple_cartesian.h>
#include <CGAL/Polyhedron_3.h>
#include <set>

struct K : public CGAL::Simple_cartesian<double> {};
struct Poly : public CGAL::Polyhedron_3<K> {};

int main()
{
Poly::Vertex_const_handle h;
std::set<Poly::Vertex_const_handle> s;

s.insert( h );
}

============ </CODE: main.cpp> =============


============ <ERROR MESSAGE> =============

<... lots of template error messages ...>
main.cpp:13: instantiated from here
/usr/lib/gcc/i686-pc-linux-gnu/4.1.1/include/g++-v4/bits/stl_function.h:227:
error: no match for 'operator<' in '__x < __y'
make: *** [main.o] Error 1

============ </ERROR MESSAGE> =============

--
Dipl. Inform Tom Bobach, University of Kaiserslautern
Geometric Algorithms Group
P.O. Box 3049
D-67653 Kaiserslautern
Germany
Phone: 0631-205 3800
Fax: 0631-205 3270




Archive powered by MHonArc 2.6.16.

Top of Page