Subject: [Boost-bugs] [Boost C++ Libraries] #3410: Warnings in Boost::function when compiled with "-Wold-style-cast"
From: Boost C++ Libraries (noreply_at_[hidden])
Date: 2009-09-07 08:31:36
#3410: Warnings in Boost::function when compiled with "-Wold-style-cast"
-------------------------------------+--------------------------------------
Reporter: c-rom ( -at- ) gmx . de | Owner: dgregor
Type: Bugs | Status: new
Milestone: Boost 1.41.0 | Component: function
Version: Boost 1.40.0 | Severity: Cosmetic
Keywords: old-style-cast |
-------------------------------------+--------------------------------------
Boost::function reports warnings when compiled with "-Wold-style-cast".
There are several old style casts left (besides many "new style casts", so
this might be harmonized)
in files:
boost/function/function_base.hpp
boost/function/function_template.hpp
Please see ticket #2983 which is very similar to this one.
The following code example reproduces the issue with Boost 1.40:
Example.cpp
%<-------------------------------------
#include <iostream>
#include <boost/function.hpp>
struct add
{
int operator()( int arg1, int arg2 )
{
return ( arg1 + arg2 );
}
};
int main( int argc, char** argv )
{
boost::function<int ( int, int )> f;
f = add();
std::cout << f( 2, 2 ) << std::endl;
return 0;
}
%<-------------------------------------
The piece of code for this bug report has been compiled with g++ (GCC)
3.4.3:
g++ -Wold-style-cast -o Example -I<PATH_TO_BOOST> Example.cpp
-- Ticket URL: <https://svn.boost.org/trac/boost/ticket/3410> Boost C++ Libraries <http://www.boost.org/> Boost provides free peer-reviewed portable C++ source libraries.
This archive was generated by hypermail 2.1.7 : 2017-02-16 18:50:01 UTC