|
Boost Users : |
Subject: Re: [Boost-users] A question on overloaded function? Can anyone with kindness help me?
From: fmingu (fmingu_at_[hidden])
Date: 2009-07-01 21:39:53
I do not understand the sentence:
Ignore the "conversion to unsigned int" part.
As you know, I am a new comer and quite puzzled about that.
Does that mean to change the complier enviroment?
Can you give me an example?
Thank you for your kindness.
ÔÚ2009-07-02£¬"Steven Watanabe" <watanabesj_at_[hidden]> дµÀ£º
>AMDG
>
>fmingu wrote:
>> But how can I change the expression to be legal and usable?
>> bind(&std::pow,constant(-1),bind(&IIPrimemap::size,var(primemapvec)));
>> I tried :
>> bind(&std::pow,constant(-1.0),bind<int>(&IIPrimemap::size,var(primemapvec)));
>> and
>> bind(&std::pow,constant(-1.0),ret<int>(bind(&IIPrimemap::size,var(primemapvec))));
>> even
>> bind(&std::pow,constant(-1.0),ll_dynamic_cast<int>(bind(&IIPrimemap::size,var(primemapvec))));
>> But the complier told me that:
>> cannot resolve overloaded function `pow' based on conversion to
>> type `unsigned int'
>>
>
>Ignore the "conversion to unsigned int" part. The compiler
>doesn't know how to handle std::pow and gets itself confused.
>The problem is &std::pow, not the inner bind expression.
>
>> I do not know how to solve now.
>> Can anyone with kindness help me?
>>
>>
>>> You can't pass the address of an overloaded function to
>>> a function template like bind without casting it to the
>>> correct function pointer type.
>>>
>
>In Christ,
>Steven Watanabe
>
200ÍòÖÖÉÌÆ·,×îµÍ¼Û¸ñ,·è¿ñÓÕ»óÄã
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