Boost logo

Boost :

Subject: Re: [boost] [result_of, tr1] decltype and incomplete types
From: Eric Niebler (eric_at_[hidden])
Date: 2010-04-11 15:29:32


On 4/11/2010 9:37 AM, Daniel Walker wrote:
> On Sat, Apr 10, 2010 at 7:50 PM, Eric Niebler <eric_at_[hidden]> wrote:
>> If Boost.TR1 advertises itself as an implementation of TR1, then it
>> should have an implementation of result_of that doesn't rely on
>> decltype. (Waiting for John to jump in here.) That way, libraries like
>> Proto that need the tr1 behavior (until decltype is fixed) can use
>> std::tr1::result_of from boost/tr1/functional.hpp and forget about it.
>> This should be possible in the 1.44 time frame and is a good long-term
>> solution.
>
> Agreed.

Note that to make this happen, you'll need to coordinate with John. The
way Boost.TR1 works is like this:

- If the platform implements <tr1/foo_header>, include it. Otherwise,
- Include <boost/foo_header.hpp> and bring boost::foo into the std::tr1
namespace with a using declaration.

If boost::result_of sometimes uses decltype, the above won't work
because then std::tr1::result_of will sometimes use decltype. It seems
to me that <boost/utility/result_of.hpp> should expose a
boost::tr1_result_of that can be used by <boost/tr1/result_of.hpp> to
get the TR1 behavior regardless of whether decltype exists or not.

-- 
Eric Niebler
BoostPro Computing
http://www.boostpro.com

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