Subject: CGAL users discussion list
List archive
- From: Andreas Fabri <>
- To:
- Subject: Re: [cgal-discuss] HalfedgeDS_*::Vertex_handle in std::set and std::map?
- Date: Fri, 28 Sep 2007 11:54:44 +0200
Bart Janssens wrote:
On 9/28/07, Tom Bobach
<>
wrote:
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.
I got around the problem using probably the least elegant, but easiest
solution: I dereferenced the handle, and then stored the address of
the resulting object in an std::map, i.e. map[&(*handle)] = blah;
regards,
Hello,
You can define
bool operator< ( const Handle& x, const Handle& y )
{
return &*x < &*y ;
}
As the std::map takes std::less as default comparason functor
and this one applies operator< this solves all these problems.
andreas
- HalfedgeDS_*::Vertex_handle in std::set and std::map?, Tom Bobach, 09/28/2007
- Re: [cgal-discuss] HalfedgeDS_*::Vertex_handle in std::set and std::map?, Wesley Smith, 09/28/2007
- Re: [cgal-discuss] HalfedgeDS_*::Vertex_handle in std::set and std::map?, Stefan Schirra, 09/28/2007
- Re: [cgal-discuss] HalfedgeDS_*::Vertex_handle in std::set and std::map?, Tom Bobach, 09/28/2007
- Re: [cgal-discuss] HalfedgeDS_*::Vertex_handle in std::set and std::map?, Stefan Schirra, 09/28/2007
- Re: [cgal-discuss] HalfedgeDS_*::Vertex_handle in std::set and std::map?, Andreas Fabri, 09/28/2007
- Re: [cgal-discuss] HalfedgeDS_*::Vertex_handle in std::set and std::map?, Stefan Schirra, 09/28/2007
- Re: [cgal-discuss] HalfedgeDS_*::Vertex_handle in std::set and std::map?, Tom Bobach, 09/28/2007
- Re: [cgal-discuss] HalfedgeDS_*::Vertex_handle in std::set and std::map?, Bart Janssens, 09/28/2007
- Re: [cgal-discuss] HalfedgeDS_*::Vertex_handle in std::set and std::map?, Andreas Fabri, 09/28/2007
Archive powered by MHonArc 2.6.16.