Boost logo

Boost Users :

From: Irek Szczesniak (ijs_at_[hidden])
Date: 2006-04-21 16:39:52


Hi,

Thank you all for responding to my post. Now I have my own operator
function object for the comparison as you advised:

struct cmp_edge :
   public std::binary_function<Edge, Edge, bool>
{
   bool operator()(const Edge &e1, const Edge &e2) const
   {
     return e1.get_property() < e2.get_property();
   }
};

Now I can use std::map<Edge, double, cmp_edge>.

Thanks & best,
Irek

Jeremy Siek wrote:

> Yes, I also recommend the function object approach. You won't
> have to worry about which namespace the function object
> is in... this avoids the argument dependent lookup issues
> that caused problems for the global operator<.
>
> Cheers,
> Jeremy
>
>
> On Apr 20, 2006, at 10:26 PM, Thomas Costa wrote:
>
>
>>write your own total ordering/comparison function object for Edge
>>objects and declare the map type using this function.
>
> _______________________________________________
> Boost-users mailing list
> Boost-users_at_[hidden]
> http://lists.boost.org/mailman/listinfo.cgi/boost-users
>


Boost-users list run by williamkempf at hotmail.com, kalb at libertysoft.com, bjorn.karlsson at readsoft.com, gregod at cs.rpi.edu, wekempf at cox.net