|
Boost : |
From: David Abrahams (dave_at_[hidden])
Date: 2003-08-28 12:03:50
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.
-- Dave Abrahams Boost Consulting www.boost-consulting.com
Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk