Boost logo

Boost Users :

From: Seweryn Habdank-Wojewódzki (habdank_at_[hidden])
Date: 2007-03-26 15:39:49


Hi!

Douglas Gregor wrote:

>> template < typename T, typename U >
>> void test ( boost::function<T(U)> & f );
> [snip]
>> boost::function<int (void)> h = &f3;
>> boost::function<void (void)> i = &f4;
>
> The problem is that "int(void)" is just an alternative spelling for
> "int()", i.e., a function type for a function that takes no parameters
> but returns an "int". A function type int() cannot match a template
> parameter T(U), because there is nothing to match the "U".

Thanks for reply. However still I do not know how to proceed in that case,
because functions can not be partially specialized. Is there any
opportunity to prepare more less such a function which will automatically
detects arguments of boost::function template?

Best regards.

-- 
|\/\/|   Seweryn Habdank-Wojewódzki
 \/\/

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