Boost logo

Boost :

From: Stefan Slapeta (stefan_at_[hidden])
Date: 2004-07-26 02:29:10


 

> -----Original Message-----
> From: boost-bounces_at_[hidden]
> [mailto:boost-bounces_at_[hidden]] On Behalf Of David Abrahams
>
> > This warning in the extract test case should also be
> disabled for Intel 8:
> >
> > ..\libs\python\test\extract.cpp(59): warning #473:
> returning reference
> > to local temporary
> > return extract<std::string const&>(x);
> > ^
>
> Feel free.

Should be done by somebody with a write access. Just increase the Intel
version number in the code from 7 to 8.

>
> > BTW, is this a compiler defect?
>
> Yes.
>

I still don't see why? Aren't you (indirectly) returning a reference to a
local object?

std::string const& extract_string_cref(object x)
{
    // [disable warnings]
    return extract<std::string const&>(x);
    // [enable warnings]
}

Stefan


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