Boost logo

Boost Users :

From: David Abrahams (dave_at_[hidden])
Date: 2005-06-21 17:45:23


Douglas Gregor <doug.gregor_at_[hidden]> writes:

> On Jun 19, 2005, at 10:32 AM, Brian Braatz wrote:
>> My question is, given:
>>
>> boost::function< int (char, long) > func(&f);
>>
>> how is it possible to pass the (char,long)? (I tried to receive this in
>> a template as a single template param, or as three , but neither
>> worked)
>
> int (char, long) is a function type, i.e., the type that the pointer
> type int (*)(char, long) points to. You can pull apart a point type
> using partial specialization:
>
> template<typename> struct Honk;
>
> template<typename R, typename T1, typename T2>
> struct Honk<R(T1, T2)> { };
>
> Honk<int(char, long)> h; // R = int, T1 = char, T2 = long
>
>> I have been studying the headers, but the indirection used (FTSE :)

http://www.ftse.com/ ??

>> ) is making it hard for me to figure this one out.

I am supposed to be giving a talk that covers some of the
implementation techniques used in Boost.Function at the C++
Connections conference in Vegas,... if you can wait that long :)

-- 
Dave Abrahams
Boost Consulting
www.boost-consulting.com

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