Boost logo

Boost Users :

Subject: Re: [Boost-users] [Q] shared_ptr less than operator for std::set
From: V S P (toreason_at_[hidden])
Date: 2009-02-25 00:56:10


I found the solution to my question, it was not in shared_ptr
but instead every associative container had to be modified with a
template
argument functor that does lessthan.

On Tue, 24 Feb 2009 23:58 -0500, "V S P" <toreason_at_[hidden]> wrote:
> I am trying to use shared_ptr in
> std::set and std::vector. For std::set I was expecting that
> when I define a less than comparasing operation in my class
> (wrapped by shared ptr) -- it would actually get invoked.
>
> Instead I think it is the less than of the shared_ptr that is being
> invoked
> So I do not get the ordering I expect in my std::set container.
>
>
> Therefore wanted to ask -- how can it be done, that the
> operator.< of my class and not the shared_ptr's is being used by
> std::set
>
> I searched for posting on this subject but did not come up with the
> solution.
> Only discussions about the details of pointer comparasing
>
> http://aspn.activestate.com/ASPN/Mail/Message/boost/1863117
>
> VSP
>
> --
> V S P
> toreason_at_[hidden]
>
> --
> http://www.fastmail.fm - Same, same, but different...
>

-- 
  V S P
  toreason_at_[hidden]
-- 
http://www.fastmail.fm - Faster than the air-speed velocity of an
                          unladen european swallow

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