Boost logo

Boost :

From: David Abrahams (dave_at_[hidden])
Date: 2004-07-05 21:00:27


Howard Hinnant <hinnant_at_[hidden]> writes:

> On Jul 5, 2004, at 7:46 PM, David Abrahams wrote:
>
>> "Edward Diener" <eddielee_at_[hidden]> writes:
>>
>>> What are the issues with call_traits which make it unusable ?
>>
>> As far as I can tell, there is no clear documentation of what
>> _precisely_ any partcular member of call_traits<T> is for a given T.
>> It's even less clear what fallback the library uses when a full
>> implementation of call_traits would require partial specialization
>> that isn't available.
>>
>> It seems as though the documentation is intended to be a more abstract
>> description of what happens, but it leaves me (at least) feeling very
>> unclear about what I'm actually getting.
>>
>> It's also unclear to me what purpose is served by the "reference" and
>> "const_reference" members.
>
> As I recall, call_traits was intended to work around the "reference to
> reference" problem for both parameters and return types. This problem
> has since been solved by cwg #106 (
> http://www.open-std.org/jtc1/sc22/wg21/docs/cwg_defects.html#106 ).

Or by boost::add_reference ;-)

> Though I'm unsure how widely implemented this dr is in current
> compilers. I initially viewed call_traits as a way to optimize
> whether a type should be passed by const ref or by value. But I was
> mistaken. The real value was in passing/returning reference types
> without bumping into the reference-to-reference problem.

Well that one's neatly handled by the Type Traits library.

-- 
Dave Abrahams
Boost Consulting
http://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