Boost logo

Boost :

From: Peter Dimov (pdimov_at_[hidden])
Date: 2004-05-27 06:05:41


Gennadiy Rozental wrote:
> Maybe new subject better explain what I looking for.
>
> Any suggestions?
>
> Gennadiy.
>
>>> add( BOOST_PARAM_TEST_CASE( bind( &test_mask, _1, 0x80 ),
>>> parameters_list.begin(), parameters_list.end() ) ) );
>>>
>>> I get the following error:
>>>
>>> error C2661: 'boost::unit_test_framework::create_test_case' : no
>>> overloaded function takes 4 arguments
>>
>> It all caused by the fact that following fails:
>>
>> void moo( int , int )
>> {
>> }
>>
>> template<typename T>
>> void foo( boost::function1<void,T> const& f )
>> {
>>
>> }
>>
>> ...
>>
>> foo( bind( &moo, _1, 1 ) );

This is not bind-specific. Try, for example:

void test(int)
{
}

int main()
{
    foo( test );
}

T in function1<void, T> can only be deduced from function1<void, U>. No
other function object will work.


Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk