|
Boost : |
Subject: Re: [boost] [config] vc10 and BOOST_NO_DECLTYPE
From: Stephan T. Lavavej (stl_at_[hidden])
Date: 2010-04-20 13:50:51
Filed as internal bug number Dev10#891430.
Thanks,
Stephan T. Lavavej
Visual C++ Libraries Developer
-----Original Message-----
From: boost-bounces_at_[hidden] [mailto:boost-bounces_at_[hidden]] On Behalf Of Anthony Williams
Sent: Tuesday, April 20, 2010 3:06 AM
To: boost_at_[hidden]
Subject: Re: [boost] [config] vc10 and BOOST_NO_DECLTYPE
Beman Dawes <bdawes_at_[hidden]> writes:
> On Tue, Apr 6, 2010 at 3:49 PM, Eric Niebler <eric_at_[hidden]> wrote:
>>...
>>
>> The issue is whether the decltype keyword is too broken on VC10 to define
>> BOOST_NO_DECLTYPE. I think it /may/ be, so we should define it just to be
>> safe, at least for 1.43.
>
> Eric, where do we stand on this? Does the VC10 decltype problem in the
> beta still exist in the final release of VC10?
decltype is still broken in the final release of VC10. e.g. the
following code deduces the return type of getOne() to be one& rather
than one, causing an error on the "res r" line. Bizarrely, this problem
goes away if NO_CONSTRUCTOR is defined, as the return type is deduced
correctly.
I am also aware of other scenarios where decltype doesn't work correctly
on VC10, but don't have good test cases for them.
class one
{
#ifndef NO_CONSTRUCTOR
public:
one()
{}
#endif
};
one getOne()
{
return one();
}
template<typename F>
void baz(F f)
{
typedef decltype(f()) res;
res r;
}
int main()
{
baz(getOne);
}
Anthony
-- Author of C++ Concurrency in Action http://www.stdthread.co.uk/book/ just::thread C++0x thread library http://www.stdthread.co.uk Just Software Solutions Ltd http://www.justsoftwaresolutions.co.uk 15 Carrallack Mews, St Just, Cornwall, TR19 7UL, UK. Company No. 5478976 _______________________________________________ Unsubscribe & other changes: http://lists.boost.org/mailman/listinfo.cgi/boost
Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk