Boost logo

Boost Users :

Subject: Re: [Boost-users] A question on overloaded function? Can anyone with kindness help me?
From: Steven Watanabe (watanabesj_at_[hidden])
Date: 2009-07-04 22:13:03


AMDG

fmingu wrote:
> According to your suggestion,I tried to write:
> bind(static_cast<pair<IIPrimemap::iterator,bool>
> (*)(const IIPrimemap::value_type&)>
> (IIPrimemap::insert),
> bind(&make_pair<int,int>,_1,constant(1)));
> where
> typedef std::map<int, int> IIPrimemap;
> IIPrimemap primemapvec;
>
> but the complier told me that:
> invalid static_cast from type `<unknown type>' to type `
> std::pair<std::_Rb_tree_iterator<std::pair<const int, int>, std::pair<const
> int, int>&, std::pair<const int, int>*>, bool> (*)(const std::pair<const
> int, int>&)'
> Can you tell me why?
>

IIPrimemap::insert is a member function.
The syntax for a pointer to a member function is
<return type> (<class name>::*)(<args>)

In Christ,
Steven Watanabe


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