[lambda] Massive Windows warnings with containers of smart pointers
Hi all,
I'm seeing massive C4181 warnings using boost lambda on containers of
smart pointers under Windows VS2005 with Boost 1.36. The warnings do
not happen under GCC, with all warning options at maximum.
I can see from the archives that Noah Roberts posted this issue, as
well as other lambda related problems, to the list back in 2006. I
can't find an answer to the warning issue.
Our development team has a policy of zero-warning tolerance. While
it's clear that the code is working on all platforms, the warnings are
troublesome. I'm hoping that there is a work around other than just
suppressing the 4181 warnings.
Sample code and the resulting warning follows below. Thank you in
advance for any suggestions.
Best,
--
Allen Cronce
=
=
=
=
=
=
=
=
=
=
========================================================================
/*
The following is test code that generates a massive warning under
Windows:
warning C4181: qualifier applied to reference type; ignored
*/
class Foo
{
public:
Foo(void):
mValue(0)
{
};
~Foo(void)
{
};
int getValue(void) const
{
return mValue;
}
protected:
int mValue;
};
void TestBoostLambdaWarnings(void)
{
typedef boost::shared_ptr<Foo> SharedFoo_T;
vector ,boost
::tuples
::tuple
<
boost
::lambda
::lambda_functor
<
boost
::lambda
::placeholder
<
1 ,boost
::tuples
::null_type
,boost
::tuples
::null_type
,boost
::tuples
::null_type
,boost
::tuples
::null_type
,boost
::tuples
::null_type
,boost
::tuples
::null_type
,boost
::tuples
::null_type
,boost
::tuples
::null_type
,boost
::tuples
::null_type ,boost
::lambda
::detail
::bind_traits
<
boost
::tuples
::null_type ::type
,boost
::lambda
::detail
::bind_traits
<
boost
::tuples
::null_type ::type
,boost
::lambda
::detail
::bind_traits
<
boost
::tuples
::null_type ::type
,boost
::lambda
::detail
::bind_traits
<
boost
::tuples
::null_type ::type
,boost
::lambda
::detail
::bind_traits
<
boost
::tuples
::null_type ::type
,boost
::lambda
::detail
::bind_traits
<
boost
::tuples
::null_type ::type
,boost
::lambda
::detail
::bind_traits
<
boost
::tuples
::null_type ::type
,boost
::lambda::detail::bind_traitsboost::tuples::null_type::type>>>,const
int
,boost
::tuples
::null_type
,boost
::tuples
::null_type
,boost
::tuples
::null_type
,boost
::tuples
::null_type
,boost
::tuples
::null_type
,boost
::tuples::null_type,boost::tuples::null_type,boost::tuples::null_type>,
1> SigArgs=boost::tuples::tuple ,boost
::tuples
::tuple
<
boost
::lambda
::lambda_functor
<
boost
::lambda
::placeholder
<
1 ,boost
::tuples
::null_type
,boost
::tuples
::null_type
,boost
::tuples
::null_type
,boost
::tuples
::null_type
,boost
::tuples
::null_type
,boost
::tuples
::null_type
,boost
::tuples
::null_type
,boost
::tuples
::null_type
,boost
::tuples
::null_type ,boost
::lambda
::detail
::bind_traits
<
boost
::tuples
::null_type ::type
,boost
::lambda
::detail
::bind_traits
<
boost
::tuples
::null_type ::type
,boost
::lambda
::detail
::bind_traits
<
boost
::tuples
::null_type ::type
,boost
::lambda
::detail
::bind_traits
<
boost
::tuples
::null_type ::type
,boost
::lambda
::detail
::bind_traits
<
boost
::tuples
::null_type ::type
,boost
::lambda
::detail
::bind_traits
<
boost
::tuples
::null_type ::type
,boost
::lambda
::detail
::bind_traits
<
boost
::tuples
::null_type ::type
,boost
::lambda::detail::bind_traitsboost::tuples::null_type::type>>>,const
int
,boost
::tuples
::null_type
,boost
::tuples
::null_type
,boost
::tuples
::null_type
,boost
::tuples
::null_type
,boost
::tuples
::null_type
,boost
::tuples::null_type,boost::tuples::null_type,boost::tuples::null_type>,
1> SigArgs=boost::tuples::tuple ,boost
::tuples
::tuple
<
boost
::lambda
::lambda_functor
<
boost
::lambda
::placeholder
<
1 ,boost
::tuples
::null_type
,boost
::tuples
::null_type
,boost
::tuples
::null_type
,boost
::tuples
::null_type
,boost
::tuples
::null_type
,boost
::tuples
::null_type
,boost
::tuples
::null_type
,boost
::tuples
::null_type
,boost
::tuples
::null_type ,boost
::lambda
::detail
::bind_traits
<
boost
::tuples
::null_type ::type
,boost
::lambda
::detail
::bind_traits
<
boost
::tuples
::null_type ::type
,boost
::lambda
::detail
::bind_traits
<
boost
::tuples
::null_type ::type
,boost
::lambda
::detail
::bind_traits
<
boost
::tuples
::null_type ::type
,boost
::lambda
::detail
::bind_traits
<
boost
::tuples
::null_type ::type
,boost
::lambda
::detail
::bind_traits
<
boost
::tuples
::null_type ::type
,boost
::lambda
::detail
::bind_traits
<
boost
::tuples
::null_type ::type
,boost
::lambda::detail::bind_traitsboost::tuples::null_type::type>>>,const
int
,boost
::tuples
::null_type
,boost
::tuples
::null_type
,boost
::tuples
::null_type
,boost
::tuples
::null_type
,boost
::tuples
::null_type
,boost
::tuples::null_type,boost::tuples::null_type,boost::tuples::null_type>,
1> Open=boost::tuples::tuple ,boost
::tuples
::tuple
<
boost
::lambda
::lambda_functor
<
boost
::lambda
::placeholder
<
1 ,boost
::tuples
::null_type
,boost
::tuples
::null_type
,boost
::tuples
::null_type
,boost
::tuples
::null_type
,boost
::tuples
::null_type
,boost
::tuples
::null_type
,boost
::tuples
::null_type
,boost
::tuples
::null_type
,boost
::tuples
::null_type ,boost
::lambda
::detail
::bind_traits
<
boost
::tuples
::null_type ::type
,boost
::lambda
::detail
::bind_traits
<
boost
::tuples
::null_type ::type
,boost
::lambda
::detail
::bind_traits
<
boost
::tuples
::null_type ::type
,boost
::lambda
::detail
::bind_traits
<
boost
::tuples
::null_type ::type
,boost
::lambda
::detail
::bind_traits
<
boost
::tuples
::null_type ::type
,boost
::lambda
::detail
::bind_traits
<
boost
::tuples
::null_type ::type
,boost
::lambda
::detail
::bind_traits
<
boost
::tuples
::null_type ::type
,boost
::lambda::detail::bind_traitsboost::tuples::null_type::type>>>,const
int
,boost
::tuples
::null_type
,boost
::tuples
::null_type
,boost
::tuples
::null_type
,boost
::tuples
::null_type
,boost
::tuples
::null_type
,boost
::tuples::null_type,boost::tuples::null_type,boost::tuples::null_type>,
1> SigArgs=boost::tuples::tuple ,boost
::tuples
::tuple
<
boost
::lambda
::lambda_functor
<
boost
::lambda
::lambda_functor_base
<
boost
::lambda
::action<2,boost::lambda::function_action<2>>,boost::tuples::tuple ,boost
::tuples
::tuple
<
boost
::lambda
::lambda_functor
<
boost
::lambda
::placeholder
<
1 ,boost
::tuples
::null_type
,boost
::tuples
::null_type
,boost
::tuples
::null_type
,boost
::tuples
::null_type
,boost
::tuples
::null_type
,boost
::tuples
::null_type
,boost
::tuples
::null_type
,boost
::tuples
::null_type
,boost
::tuples
::null_type ,boost
::lambda
::detail
::bind_traits
<
boost
::tuples
::null_type ::type
,boost
::lambda
::detail
::bind_traits
<
boost
::tuples
::null_type ::type
,boost
::lambda
::detail
::bind_traits
<
boost
::tuples
::null_type ::type
,boost
::lambda
::detail
::bind_traits
<
boost
::tuples
::null_type ::type
,boost
::lambda
::detail
::bind_traits
<
boost
::tuples
::null_type ::type
,boost
::lambda
::detail
::bind_traits
<
boost
::tuples
::null_type ::type
,boost
::lambda
::detail
::bind_traits
<
boost
::tuples
::null_type ::type
,boost
::lambda::detail::bind_traitsboost::tuples::null_type::type>>>,const
int
,boost
::tuples
::null_type
,boost
::tuples
::null_type
,boost
::tuples
::null_type
,boost
::tuples
::null_type
,boost
::tuples
::null_type
,boost
::tuples::null_type,boost::tuples::null_type,boost::tuples::null_type>>>
1> ]
1> c:\sources\client\pace\libraries\src\libpaceutil
\libpaceutil_test.cpp(2213) : see reference to function template
instantiation '_InIt
std
::find_if
<
std
::_Vector_iterator
<_Ty,_Alloc>,boost::lambda::lambda_functor<T>>(_InIt,_InIt,_Pr)' being
compiled
1> with
1> [
1>
_InIt=std::_Vector_iterator ,boost
::tuples
::tuple
<
boost
::lambda
::lambda_functor
<
boost
::lambda
::lambda_functor_base
<
boost
::lambda
::action<2,boost::lambda::function_action<2>>,boost::tuples::tuple ,boost
::tuples
::tuple
<
boost
::lambda
::lambda_functor
<
boost
::lambda
::placeholder
<
1 ,boost
::tuples
::null_type
,boost
::tuples
::null_type
,boost
::tuples
::null_type
,boost
::tuples
::null_type
,boost
::tuples
::null_type
,boost
::tuples
::null_type
,boost
::tuples
::null_type
,boost
::tuples
::null_type
,boost
::tuples
::null_type ,boost
::lambda
::detail
::bind_traits
<
boost
::tuples
::null_type ::type
,boost
::lambda
::detail
::bind_traits
<
boost
::tuples
::null_type ::type
,boost
::lambda
::detail
::bind_traits
<
boost
::tuples
::null_type ::type
,boost
::lambda
::detail
::bind_traits
<
boost
::tuples
::null_type ::type
,boost
::lambda
::detail
::bind_traits
<
boost
::tuples
::null_type ::type
,boost
::lambda
::detail
::bind_traits
<
boost
::tuples
::null_type ::type
,boost
::lambda
::detail
::bind_traits
<
boost
::tuples
::null_type ::type
,boost
::lambda::detail::bind_traitsboost::tuples::null_type::type>>>,const
int
,boost
::tuples
::null_type
,boost
::tuples
::null_type
,boost
::tuples
::null_type
,boost
::tuples
::null_type
,boost
::tuples
::null_type
,boost
::tuples::null_type,boost::tuples::null_type,boost::tuples::null_type>>,
1>
_Pr
=
boost
::lambda
::lambda_functor
<
boost
::lambda
::lambda_functor_base
<
boost
::lambda
::relational_action
<
boost
::lambda
::equal_action ,boost
::tuples
::tuple
<
boost
::lambda
::lambda_functor
<
boost
::lambda
::lambda_functor_base
<
boost
::lambda
::action<2,boost::lambda::function_action<2>>,boost::tuples::tuple ,boost
::tuples
::tuple
<
boost
::lambda
::lambda_functor
<
boost
::lambda
::placeholder
<
1 ,boost
::tuples
::null_type
,boost
::tuples
::null_type
,boost
::tuples
::null_type
,boost
::tuples
::null_type
,boost
::tuples
::null_type
,boost
::tuples
::null_type
,boost
::tuples
::null_type
,boost
::tuples
::null_type
,boost
::tuples
::null_type ,boost
::lambda
::detail
::bind_traits
<
boost
::tuples
::null_type ::type
,boost
::lambda
::detail
::bind_traits
<
boost
::tuples
::null_type ::type
,boost
::lambda
::detail
::bind_traits
<
boost
::tuples
::null_type ::type
,boost
::lambda
::detail
::bind_traits
<
boost
::tuples
::null_type ::type
,boost
::lambda
::detail
::bind_traits
<
boost
::tuples
::null_type ::type
,boost
::lambda
::detail
::bind_traits
<
boost
::tuples
::null_type ::type
,boost
::lambda
::detail
::bind_traits
<
boost
::tuples
::null_type ::type
,boost
::lambda::detail::bind_traitsboost::tuples::null_type::type>>>,const
int
,boost
::tuples
::null_type
,boost
::tuples
::null_type
,boost
::tuples
::null_type
,boost
::tuples
::null_type
,boost
::tuples
::null_type
,boost
::tuples::null_type,boost::tuples::null_type,boost::tuples::null_type>>>
1> ]
AMDG Allen Cronce wrote:
I'm seeing massive C4181 warnings using boost lambda on containers of smart pointers under Windows VS2005 with Boost 1.36. The warnings do not happen under GCC, with all warning options at maximum.
I can see from the archives that Noah Roberts posted this issue, as well as other lambda related problems, to the list back in 2006. I can't find an answer to the warning issue.
Our development team has a policy of zero-warning tolerance. While it's clear that the code is working on all platforms, the warnings are troublesome. I'm hoping that there is a work around other than just suppressing the 4181 warnings.
Sample code and the resulting warning follows below. Thank you in advance for any suggestions.
This has been fixed in the trunk an release branch. https://svn.boost.org/trac/boost/changeset/51448 In Christ, Steven Watanabe
participants (2)
-
Allen Cronce
-
Steven Watanabe