Index: boost/lambda/detail/lambda_functors.hpp =================================================================== --- boost/lambda/detail/lambda_functors.hpp (revision 51422) +++ boost/lambda/detail/lambda_functors.hpp (working copy) @@ -105,8 +105,11 @@ // other lambda_functors. // ------------------------------------------------------------------- +#if BOOST_WORKAROUND(BOOST_MSVC, >= 1400) +#pragma warning(push) +#pragma warning(disable:4512) //assignment operator could not be generated +#endif - // -- lambda_functor NONE ------------------------------------------------ template class lambda_functor : public T @@ -244,6 +247,9 @@ } }; +#if BOOST_WORKAROUND(BOOST_MSVC, >= 1400) +#pragma warning(pop) +#endif } // namespace lambda } // namespace boost Index: boost/lambda/detail/lambda_traits.hpp =================================================================== --- boost/lambda/detail/lambda_traits.hpp (revision 51422) +++ boost/lambda/detail/lambda_traits.hpp (working copy) @@ -430,6 +430,56 @@ typedef const volatile T (&type)[n]; }; +template +struct bind_traits { + typedef R(&type)(); +}; + +template +struct bind_traits { + typedef R(&type)(Arg1); +}; + +template +struct bind_traits { + typedef R(&type)(Arg1, Arg2); +}; + +template +struct bind_traits { + typedef R(&type)(Arg1, Arg2, Arg3); +}; + +template +struct bind_traits { + typedef R(&type)(Arg1, Arg2, Arg3, Arg4); +}; + +template +struct bind_traits { + typedef R(&type)(Arg1, Arg2, Arg3, Arg4, Arg5); +}; + +template +struct bind_traits { + typedef R(&type)(Arg1, Arg2, Arg3, Arg4, Arg5, Arg6); +}; + +template +struct bind_traits { + typedef R(&type)(Arg1, Arg2, Arg3, Arg4, Arg5, Arg6, Arg7); +}; + +template +struct bind_traits { + typedef R(&type)(Arg1, Arg2, Arg3, Arg4, Arg5, Arg6, Arg7, Arg8); +}; + +template +struct bind_traits { + typedef R(&type)(Arg1, Arg2, Arg3, Arg4, Arg5, Arg6, Arg7, Arg8, Arg9); +}; + template struct bind_traits >{ typedef T& type; Index: boost/lambda/detail/suppress_unused.hpp =================================================================== --- boost/lambda/detail/suppress_unused.hpp (revision 0) +++ boost/lambda/detail/suppress_unused.hpp (revision 0) @@ -0,0 +1,27 @@ +// Boost Lambda Library suppress_unused.hpp ----------------------------- +// +// Copyright (C) 2009 Steven Watanabe +// +// Distributed under the Boost Software License, Version 1.0. (See +// accompanying file LICENSE_1_0.txt or copy at +// http://www.boost.org/LICENSE_1_0.txt) +// +// For more information, see www.boost.org + +// ------------------------------------------------------------ + +#ifndef BOOST_LAMBDA_SUPRESS_UNUSED_HPP +#define BOOST_LAMBDA_SUPRESS_UNUSED_HPP + +namespace boost { +namespace lambda { +namespace detail { + +template +inline void suppress_unused_variable_warnings(const T&) {} + +} +} +} + +#endif Property changes on: boost\lambda\detail\suppress_unused.hpp ___________________________________________________________________ Name: svn:mime-type + text/plain Name: svn:keywords + Id Name: svn:eol-style + native Index: boost/lambda/detail/lambda_functor_base.hpp =================================================================== --- boost/lambda/detail/lambda_functor_base.hpp (revision 51422) +++ boost/lambda/detail/lambda_functor_base.hpp (working copy) @@ -16,6 +16,10 @@ namespace boost { namespace lambda { +#if BOOST_WORKAROUND(BOOST_MSVC, >= 1400) +#pragma warning(push) +#pragma warning(disable:4512) //assignment operator could not be generated +#endif // for return type deductions we wrap bound argument to this class, // which fulfils the base class contract for lambda_functors @@ -42,6 +46,10 @@ RET call(CALL_FORMAL_ARGS) const { CALL_USE_ARGS; return elem; } }; +#if BOOST_WORKAROUND(BOOST_MSVC, >= 1400) +#pragma warning(pop) +#endif + template inline lambda_functor > var(T& t) { return identity(t); } @@ -337,7 +345,7 @@ { public: // Args args; not needed - explicit lambda_functor_base(const Args& a) {} + explicit lambda_functor_base(const Args& /*a*/) {} template struct sig { typedef typename return_type_N::type type; Index: boost/lambda/detail/operator_return_type_traits.hpp =================================================================== --- boost/lambda/detail/operator_return_type_traits.hpp (revision 51422) +++ boost/lambda/detail/operator_return_type_traits.hpp (working copy) @@ -233,28 +233,31 @@ // the IF is because the A::reference in the primary template could // be some class type rather than a real reference, hence // we do not want to make it a reference here either - typedef typename detail::IF< + typedef typename boost::remove_reference::type no_reference; + typedef typename detail::IF< is_reference::value, - const typename boost::remove_reference::type &, - const type1 + const no_reference &, + const no_reference >::RET type; }; template struct contentsof_type { typedef typename contentsof_type::type type1; + typedef typename boost::remove_reference::type no_reference; typedef typename detail::IF< is_reference::value, - volatile typename boost::remove_reference::type &, - volatile type1 + volatile no_reference &, + volatile no_reference >::RET type; }; template struct contentsof_type { typedef typename contentsof_type::type type1; + typedef typename boost::remove_reference::type no_reference; typedef typename detail::IF< is_reference::value, - const volatile typename boost::remove_reference::type &, - const volatile type1 + const volatile no_reference &, + const volatile no_reference >::RET type; }; Index: boost/lambda/casts.hpp =================================================================== --- boost/lambda/casts.hpp (revision 51422) +++ boost/lambda/casts.hpp (working copy) @@ -14,6 +14,8 @@ #if !defined(BOOST_LAMBDA_CASTS_HPP) #define BOOST_LAMBDA_CASTS_HPP +#include "boost/lambda/detail/suppress_unused.hpp" + #include namespace boost { @@ -64,11 +66,12 @@ } }; - // typedid action +// typeid action class typeid_action { public: template static RET apply(Arg1 &a1) { + detail::suppress_unused_variable_warnings(a1); return typeid(a1); } }; Index: boost/lambda/switch.hpp =================================================================== --- boost/lambda/switch.hpp (revision 51422) +++ boost/lambda/switch.hpp (working copy) @@ -465,12 +465,18 @@ #define BOOST_LAMBDA_SWITCH_STATEMENT_HELPER(z, N, A) \ BOOST_LAMBDA_SWITCH_STATEMENT(BOOST_PP_INC(N)) +#ifdef BOOST_MSVC +#pragma warning(push) +#pragma warning(disable:4065) +#endif - // up to 9 cases supported (counting default:) BOOST_PP_REPEAT_2ND(9,BOOST_LAMBDA_SWITCH_HELPER,FOO) BOOST_PP_REPEAT_2ND(9,BOOST_LAMBDA_SWITCH_STATEMENT_HELPER,FOO) +#ifdef BOOST_MSVC +#pragma warning(pop) +#endif } // namespace lambda } // namespace boost Index: libs/lambda/test/member_pointer_test.cpp =================================================================== --- libs/lambda/test/member_pointer_test.cpp (revision 51422) +++ libs/lambda/test/member_pointer_test.cpp (working copy) @@ -118,11 +118,11 @@ class D {}; // ->* can be overloaded to do anything -bool operator->*(A a, B b) { +bool operator->*(A /*a*/, B /*b*/) { return false; } -bool operator->*(B b, A a) { +bool operator->*(B /*b*/, A /*a*/) { return true; } Index: libs/lambda/test/constructor_tests.cpp =================================================================== --- libs/lambda/test/constructor_tests.cpp (revision 51422) +++ libs/lambda/test/constructor_tests.cpp (working copy) @@ -24,6 +24,10 @@ #include #include +#ifdef BOOST_MSVC +#pragma warning(disable:4512) +#endif + using namespace boost::lambda; using namespace std; @@ -34,7 +38,7 @@ } template <> -bool check_tuple(int n, const null_type& ) { return true; } +bool check_tuple(int /*n*/, const null_type& ) { return true; } void constructor_all_lengths() @@ -183,7 +187,7 @@ void test_destructor () { char space[sizeof(is_destructor_called)]; - bool flag; + bool flag = false; is_destructor_called* idc = new(space) is_destructor_called(flag); BOOST_CHECK(flag == false); Index: libs/lambda/test/extending_rt_traits.cpp =================================================================== --- libs/lambda/test/extending_rt_traits.cpp (revision 51422) +++ libs/lambda/test/extending_rt_traits.cpp (working copy) @@ -16,6 +16,7 @@ #include "boost/lambda/bind.hpp" #include "boost/lambda/lambda.hpp" +#include "boost/lambda/detail/suppress_unused.hpp" #include @@ -23,6 +24,8 @@ #include +using boost::lambda::detail::suppress_unused_variable_warnings; + class A {}; class B {}; @@ -81,7 +84,7 @@ } // lambda } // boost -void ok(B b) {} +void ok(B /*b*/) {} void test_unary_operators() { @@ -127,7 +130,7 @@ template my_vector, A&, B&>::type> -operator+(const my_vector& a, const my_vector& b) +operator+(const my_vector& /*a*/, const my_vector& /*b*/) { typedef typename return_type_2, A&, B&>::type res_type; @@ -175,8 +178,8 @@ // assignment class Assign { public: - void operator=(const Assign& a) {} - X operator[](const int& i) { return X(); } + void operator=(const Assign& /*a*/) {} + X operator[](const int& /*i*/) { return X(); } }; @@ -329,9 +332,16 @@ XX dummy3 = (_1 * _2)(vxx, vyy); VV dummy4 = (_1 * _2)(cvxx, cvyy); + suppress_unused_variable_warnings(dummy1); + suppress_unused_variable_warnings(dummy2); + suppress_unused_variable_warnings(dummy3); + suppress_unused_variable_warnings(dummy4); + my_vector v1; my_vector v2; my_vector d = (_1 + _2)(v1, v2); + suppress_unused_variable_warnings(d); + // bitwise (_1 << _2)(x, y); Index: libs/lambda/test/operator_tests_simple.cpp =================================================================== --- libs/lambda/test/operator_tests_simple.cpp (revision 51422) +++ libs/lambda/test/operator_tests_simple.cpp (working copy) @@ -17,6 +17,8 @@ #include "boost/lambda/lambda.hpp" +#include "boost/lambda/detail/suppress_unused.hpp" + #include #include #include @@ -96,6 +98,8 @@ // test that unary plus really does something unary_plus_tester u; unary_plus_tester up = (+_1)(u); + + boost::lambda::detail::suppress_unused_variable_warnings(up); } void bitwise_operators() { Index: libs/lambda/test/exception_test.cpp =================================================================== --- libs/lambda/test/exception_test.cpp (revision 51422) +++ libs/lambda/test/exception_test.cpp (working copy) @@ -29,7 +29,7 @@ using namespace std; // to prevent unused variables warnings -template void dummy(const T& t) {} +template void dummy(const T&) {} void erroneous_exception_related_lambda_expressions() { @@ -603,7 +603,7 @@ return_type_matching(); test_empty_catch_blocks(); } - catch (int x) + catch (int) { BOOST_CHECK(false); }