From: Sean Parent (sparent_at_[hidden])
Date: 2004-12-06 17:46:26


On Dec 6, 2004, at 2:02 PM, Peter Dimov wrote:

>
> I get warning C4172 from VC++ 7.1, "returning address of local
> variable or temporary", on this example (in
> function_template.hpp:111).
>

In CodeWarrior 9.3 BOOST_NO_VOID_RETURNS is not defined so in
function.hpp the code falls into the static_cast<> case

-----

# ifndef BOOST_NO_VOID_RETURNS
       return static_cast<result_type>(result);
# else
       return result;
# endif // BOOST_NO_VOID_RETURNS

------

This silences the warning - and you get no indication that anything is
wrong.

Just to make sure - you plan to leave it returning by value? If that is
the case I'll update my code (I had patched my copy of boost).

Thanks!
Sean