Boost logo

Boost :

Subject: Re: [boost] Boost.Variant is not EqualityComparable
From: Stefan Strasser (strasser_at_[hidden])
Date: 2009-11-10 15:30:26

Am Tuesday 10 November 2009 16:13:11 schrieb Cosimo Calabrese:
> Hi to all,
> I've the same problem. I've created a union graph adaptor, that provides
> a "union view" of two graphs; in that adaptor, the edge_descriptor is
> defined like this:
> typedef boost::variant<
> WR1<typename graph_traits<Graph1>::edge_descriptor>,
> WR2<typename graph_traits<Graph2>::edge_descriptor>
> > edge_descriptor;
> Now I would to use that graph to the Dijkstra's algorithm, that requires
> that the edge_descriptor models the EqualityComparable concept:
> But as we know, boost::variant doesn't support the inequality
> expression.

if that's the case then I think the error is to be found in the graph library.
EqualityComparable does not require operator !=, the SGI link above is
probably outdated. the standard (at least a draft from around 2005, I haven't
bought the official document) doesn't state that requirement.

using namespace std::rel_ops;

should fix these problems though.

Boost list run by bdawes at, gregod at, cpdaniel at, john at