Boost logo

Boost Users :

Subject: Re: [Boost-users] boost::tuple in std::map
From: Kyle Edwards (kedwards_at_[hidden])
Date: 2015-06-05 08:43:11


UJ,

Please look at the documentation for std::map for information on how to
write your own comparator. http://www.cplusplus.com/reference/map/map/

Basically, you write a comparator class that overloads the () operator
to accept two tuples, do whatever you need to do to compare them, and
provide this as the Compare parameter of the std::map template.
--

Kyle Edwards

Software Developer





20 Corporate Circle | Albany, NY 12203

office 888-4BULLEX | 518.689.2023 | fax 518.689.2034 | web:
www.bullex.com




On Fri, 2015-06-05 at 12:21 +0000, Uthpal Urubail wrote:
> Experts,
>
> I am using boost::tuple as key in std::map. I would like to write my
> own comparison method (considering tolerance in comparison)
>
>
>
> The default comparison defined in tuple_comparison.hppis of no use to
> me.
>
> Any help in this is highly appreciated.
>
> Regards,
>
> UJ
>
>
> _______________________________________________
> 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