Boost logo

Boost :

From: Joel de Guzman (djowel_at_[hidden])
Date: 2003-08-28 20:31:11


David Abrahams <dave_at_[hidden]> wrote:
> Jaakko Jarvi <jajarvi_at_[hidden]> writes:
>
>> I've noticed that call_traits doesn't support function references.
>> I'm not sure whether it makes sense to store function references in
>> optionals, though, but in any case.
>>
>> Something like this fails:
>>
>> typedef void (&afuncref)(int);
>> typedef call_traits<afunc>::reference t;
>>
>> The problem is that the call_traits templates have other typedefs in
>> the same class, e.g. const_reference, which gets instantiated as
>> well, and it adds the const qualifier to a function type.
>
> Just another reason not to write degenerate "traits BLOB"
> metafunctions. call_traits, if it's useful for anything (which I
> sometimes wonder about because I have a hard time figuring out what it
> does), should be rewritten as separate individual metafunctions.

FWIW, I find it a useful utility. However, I agree that it should be
broken down into individual pieces.

-- 
Joel de Guzman
http://www.boost-consulting.com
http://spirit.sf.net

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