|
Boost : |
From: Douglas Paul Gregor (gregod_at_[hidden])
Date: 2003-10-10 08:20:50
On Fri, 10 Oct 2003, Brian McNamara wrote:
> Hmm. While writing this up, it occurred to be that in FC++, there are a
> few places where the result_of type is maybe incorrect. For example,
> odd_list<int> oli;
> ... delay( oli ) ...
> I think that maybe delay() here returns a
> const list<int>&
> whereas result_of< delay_type( odd_list<int> ) >::type is
> list<int>
> Hmm. Interesting how you can find such "bugs" just by trying to nail
> down concepts.
>
>
> Douglas, are you reading this? Given both
> http://anubis.dkuug.dk/jtc1/sc22/wg21/docs/papers/2003/n1454.html
> and what we know about where typeof/decltype/etc. are headed in the
> standardization process, should a function object that returns a
> "const X&" declare its "result_of" to be "X" or "const X&"?
const X&
result_of is intended to ensure perfect forwarding, even if we get a
broken typeof/decltype that eats references and cv-qualifiers. If the
standardese is not clear on that regard, I would appreciate any help in
fixing it.
Doug
Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk