Boost logo

Boost Users :

From: Peter Dimov (pdimov_at_[hidden])
Date: 2005-03-15 19:35:05


Ian McCulloch wrote:
> Peter Dimov wrote:
>
>> Mini-result_of-tutorial:
>>
>> Q: What do I write in the space marked ??? below:
>>
>> template<class F, class A1, ..., class An> ??? apply( F f, A1 & a1,
>> ..., An & an )
>> {
>> return f( a1, ..., an );
>> }
>>
>> A:
>>
>> typename result_of<F(A1&, ..., An&)>::type.
>
> Is there any way to handle implicit conversions?

No, if I understand your question correctly. That is, from the caller's
point of view there is nothing to handle: you just pass the types of a1,
..., an to result_of. However writing the correct result_of specialization
for a function object that is not templated on its argument types, but has
two or more operator() overloads and relies on implicit conversions would be
a major pain.

Do you have a use case in mind?


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