Boost logo

Boost Users :

Subject: Re: [Boost-users] pointer to member function of multi_index
From: Sandeep Gupta (gupta.sandeep_at_[hidden])
Date: 2009-03-18 11:37:34


On Wed, Mar 18, 2009 at 4:19 AM, Mathias Gaunard
<mathias.gaunard_at_[hidden]> wrote:
> Sandeep Gupta wrote:
>>
>> Hi,
>>      I am sure this is due to some trivial mistake; the statement to
>> create a pointer member function insert of multi_index container fails
>> in the following code:
>>
>>
>> typedef multi_index_container<
>>     std::pair<int,int>,
>>     indexed_by<
>>     ordered_unique<member<pair<int,int>, int, &pair<int, int>::first> >
>>     >
>>     > mic;
>>
>>
>> std::pair<mic_index::iterator, bool> (mic_index::*fn)(pair<int,int>) =
>> &mic_index::insert; //compile error
>
> Are you sure the pair is taken by value?
>

Hi Gaunard,
Yes. In real code i am indexing graph vertex which can be exists as
several copies.

thanks
sandeep


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