From 2e8c4eb8f3aa7010925430591371cdebd9c2ea63 Mon Sep 17 00:00:00 2001 From: Peter Dimov Date: Thu, 6 Jul 2006 13:47:26 +0000 Subject: [PATCH 01/42] is_placeholder, is_bind_expression added. [SVN r34468] --- .../boost/lambda/detail/lambda_functors.hpp | 26 +++++++++++++++++-- 1 file changed, 24 insertions(+), 2 deletions(-) diff --git a/include/boost/lambda/detail/lambda_functors.hpp b/include/boost/lambda/detail/lambda_functors.hpp index bab2ed6..0bdafab 100644 --- a/include/boost/lambda/detail/lambda_functors.hpp +++ b/include/boost/lambda/detail/lambda_functors.hpp @@ -207,6 +207,28 @@ public: } // namespace lambda } // namespace boost +// is_placeholder + +#include + +namespace boost +{ + +template<> struct is_placeholder< lambda::lambda_functor< lambda::placeholder > > +{ + enum _vt { value = 1 }; +}; + +template<> struct is_placeholder< lambda::lambda_functor< lambda::placeholder > > +{ + enum _vt { value = 2 }; +}; + +template<> struct is_placeholder< lambda::lambda_functor< lambda::placeholder > > +{ + enum _vt { value = 3 }; +}; + +} // namespace boost + #endif - - From 85630d55a667b1a413883ec319b0e5b06aad90c4 Mon Sep 17 00:00:00 2001 From: Daryle Walker Date: Fri, 14 Jul 2006 08:04:08 +0000 Subject: [PATCH 02/42] Correct placement of base class declaration [SVN r34533] --- doc/detail/lambda_doc.xml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/doc/detail/lambda_doc.xml b/doc/detail/lambda_doc.xml index c43fb2e..968ce5a 100755 --- a/doc/detail/lambda_doc.xml +++ b/doc/detail/lambda_doc.xml @@ -163,8 +163,8 @@ The STL contains predefined function objects for some common cases (such as plus template is: - : public binary_function -struct plus { + +struct plus : public binary_function { T operator()(const T& i, const T& j) const { return i + j; } From bf50f2fe7fc07ca006f6e785a53b2a6d8ebfff99 Mon Sep 17 00:00:00 2001 From: Beman Dawes Date: Tue, 7 Nov 2006 19:11:57 +0000 Subject: [PATCH 03/42] Add copyright, license [SVN r35905] --- doc/index.html | 6 +++++- index.html | 6 +++++- 2 files changed, 10 insertions(+), 2 deletions(-) diff --git a/doc/index.html b/doc/index.html index c370e64..7b8ba3c 100644 --- a/doc/index.html +++ b/doc/index.html @@ -3,6 +3,10 @@ -Automatic redirection failed, please go to www.boost.org/doc/html/lambda.html +Automatic redirection failed, please go to www.boost.org/doc/html/lambda.html 
+

© Copyright Beman Dawes, 2001

+

Distributed under the Boost Software License, Version 1.0. (See accompanying +file LICENSE_1_0.txt or copy +at www.boost.org/LICENSE_1_0.txt)

\ No newline at end of file diff --git a/index.html b/index.html index 1b5c06e..788ea5c 100644 --- a/index.html +++ b/index.html @@ -3,6 +3,10 @@ -Automatic redirection failed, please go to www.boost.org/doc/html/lambda.html +Automatic redirection failed, please go to www.boost.org/doc/html/lambda.html 
+

© Copyright Beman Dawes, 2001

+

Distributed under the Boost Software License, Version 1.0. (See accompanying +file LICENSE_1_0.txt or copy +at www.boost.org/LICENSE_1_0.txt)

\ No newline at end of file From 9b925abaff72ec96ed107e84818fab1b14ebe9db Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jaakko=20J=C3=A4rvi?= Date: Wed, 29 Nov 2006 18:54:18 +0000 Subject: [PATCH 04/42] added ->* to the table of actions for return types deduction [SVN r36199] --- doc/lambda.xml | 1 + 1 file changed, 1 insertion(+) diff --git a/doc/lambda.xml b/doc/lambda.xml index f933d7e..21ffcfa 100644 --- a/doc/lambda.xml +++ b/doc/lambda.xml @@ -2640,6 +2640,7 @@ which require that the argument types are references. ]]> ]]> ]]> +*]]>]]> From ff0929e6e326636d098295dd52528853f14ea680 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jaakko=20J=C3=A4rvi?= Date: Wed, 29 Nov 2006 19:21:46 +0000 Subject: [PATCH 05/42] fixed bug 1444052 [SVN r36200] --- include/boost/lambda/detail/operator_return_type_traits.hpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/include/boost/lambda/detail/operator_return_type_traits.hpp b/include/boost/lambda/detail/operator_return_type_traits.hpp index d5033e5..79b422e 100644 --- a/include/boost/lambda/detail/operator_return_type_traits.hpp +++ b/include/boost/lambda/detail/operator_return_type_traits.hpp @@ -859,7 +859,7 @@ struct return_type_2, A, B> { // Forward declarations are incompatible with the libstdc++ debug mode. -#if BOOST_WORKAROUND(__GNUC__, >= 3) && _GLIBCXX_DEBUG +#if BOOST_WORKAROUND(__GNUC__, >= 3) && defined(_GLIBCXX_DEBUG) #include #include #include From 47bf3df0ae24d54962d74be351de14c0995f4d73 Mon Sep 17 00:00:00 2001 From: Daniel James Date: Sun, 7 Jan 2007 23:50:56 +0000 Subject: [PATCH 06/42] Merge fixed links from RC_1_34_0. [SVN r36660] --- doc/index.html | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/doc/index.html b/doc/index.html index 7b8ba3c..59f1bfc 100644 --- a/doc/index.html +++ b/doc/index.html @@ -6,7 +6,7 @@ Automatic redirection failed, please go to www.boost.org/doc/html/lambda.html 

© Copyright Beman Dawes, 2001

Distributed under the Boost Software License, Version 1.0. (See accompanying -file LICENSE_1_0.txt or copy +file LICENSE_1_0.txt or copy at www.boost.org/LICENSE_1_0.txt)

- \ No newline at end of file + From bd4da55f0f9694d219023fd9f6e1c4125b8caeff Mon Sep 17 00:00:00 2001 From: Peter Dimov Date: Sun, 29 Jul 2007 20:33:46 +0000 Subject: [PATCH 07/42] Rvalue support [SVN r38299] --- .../boost/lambda/detail/lambda_functors.hpp | 41 +++++++++++++ test/Jamfile | 5 +- test/istreambuf_test.cpp | 30 ++++++++++ test/rvalue_test.cpp | 57 +++++++++++++++++++ 4 files changed, 132 insertions(+), 1 deletion(-) create mode 100644 test/istreambuf_test.cpp create mode 100644 test/rvalue_test.cpp diff --git a/include/boost/lambda/detail/lambda_functors.hpp b/include/boost/lambda/detail/lambda_functors.hpp index 0bdafab..5f04297 100644 --- a/include/boost/lambda/detail/lambda_functors.hpp +++ b/include/boost/lambda/detail/lambda_functors.hpp @@ -148,6 +148,14 @@ public: >(a, cnull_type(), cnull_type(), cnull_type()); } + template + typename inherited::template sig >::type + operator()(A const& a) const { + return inherited::template call< + typename inherited::template sig >::type + >(a, cnull_type(), cnull_type(), cnull_type()); + } + template typename inherited::template sig >::type operator()(A& a, B& b) const { @@ -156,6 +164,30 @@ public: >(a, b, cnull_type(), cnull_type()); } + template + typename inherited::template sig >::type + operator()(A const& a, B& b) const { + return inherited::template call< + typename inherited::template sig >::type + >(a, b, cnull_type(), cnull_type()); + } + + template + typename inherited::template sig >::type + operator()(A& a, B const& b) const { + return inherited::template call< + typename inherited::template sig >::type + >(a, b, cnull_type(), cnull_type()); + } + + template + typename inherited::template sig >::type + operator()(A const& a, B const& b) const { + return inherited::template call< + typename inherited::template sig >::type + >(a, b, cnull_type(), cnull_type()); + } + template typename inherited::template sig >::type operator()(A& a, B& b, C& c) const @@ -165,6 +197,15 @@ public: >(a, b, c, cnull_type()); } + template + typename inherited::template sig >::type + operator()(A const& a, B const& b, C const& c) const + { + return inherited::template call< + typename inherited::template sig >::type + >(a, b, c, cnull_type()); + } + // for internal calls with env template typename inherited::template sig >::type diff --git a/test/Jamfile b/test/Jamfile index cb8be67..462b972 100644 --- a/test/Jamfile +++ b/test/Jamfile @@ -53,7 +53,10 @@ DEPENDS all : test ; [ run libs/lambda/test/phoenix_control_structures.cpp : : : : ] [ run libs/lambda/test/switch_construct.cpp : : : : ] + + [ run libs/lambda/test/rvalue_test.cpp : : : : ] + + [ run libs/lambda/test/istreambuf_test.cpp : : : : ] ; } - \ No newline at end of file diff --git a/test/istreambuf_test.cpp b/test/istreambuf_test.cpp new file mode 100644 index 0000000..6db0842 --- /dev/null +++ b/test/istreambuf_test.cpp @@ -0,0 +1,30 @@ +// istreambuf_test - test lambda function objects with istreambuf_iterator +// +// Copyright (c) 2007 Peter Dimov +// +// 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 + +#include +#include +#include +#include +#include + +int main() +{ + using namespace boost::lambda; + + std::stringstream is( "ax2" ); + + std::istreambuf_iterator b2( is ); + std::istreambuf_iterator e2; + + std::istreambuf_iterator i = std::find_if( b2, e2, _1 == 'x' ); + + BOOST_TEST( *i == 'x' ); + BOOST_TEST( std::distance( i, e2 ) == 2 ); + + return boost::report_errors(); +} diff --git a/test/rvalue_test.cpp b/test/rvalue_test.cpp new file mode 100644 index 0000000..3735185 --- /dev/null +++ b/test/rvalue_test.cpp @@ -0,0 +1,57 @@ +// rvalue_test - test lambda function objects with rvalue arguments +// +// Copyright (c) 2007 Peter Dimov +// +// 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 + +#include +#include + +int main() +{ + using namespace boost::lambda; + + int x = 0; + int const y = 1; + int const z = 2; + + BOOST_TEST( _1( x ) == 0 ); + BOOST_TEST( _1( y ) == 1 ); + BOOST_TEST( _1( 2 ) == 2 ); + + BOOST_TEST( _2( x, x ) == 0 ); + BOOST_TEST( _2( x, y ) == 1 ); + BOOST_TEST( _2( x, 2 ) == 2 ); + + BOOST_TEST( _2( 4, x ) == 0 ); + BOOST_TEST( _2( 4, y ) == 1 ); + BOOST_TEST( _2( 4, 2 ) == 2 ); + + (_1 = _2)( x, y ); + BOOST_TEST( x == y ); + + (_1 = _2)( x, 3 ); + BOOST_TEST( x == 3 ); + + (_2 = _1)( z, x ); + BOOST_TEST( x == z ); + + (_2 = _1)( 4, x ); + BOOST_TEST( x == 4 ); + + BOOST_TEST( _3( x, x, x ) == x ); + BOOST_TEST( _3( x, x, y ) == y ); + BOOST_TEST( _3( x, x, 2 ) == 2 ); + + BOOST_TEST( _3( x, 5, x ) == x ); + BOOST_TEST( _3( x, 5, y ) == y ); + BOOST_TEST( _3( x, 5, 2 ) == 2 ); + + BOOST_TEST( _3( 9, 5, x ) == x ); + BOOST_TEST( _3( 9, 5, y ) == y ); + BOOST_TEST( _3( 9, 5, 2 ) == 2 ); + + return boost::report_errors(); +} From 797b5756cf37da007f6678d8c9d2bd973bb1c5e4 Mon Sep 17 00:00:00 2001 From: Vladimir Prus Date: Wed, 8 Aug 2007 19:16:43 +0000 Subject: [PATCH 08/42] Update for V2 [SVN r38520] --- test/Jamfile | 73 ++++++++++++++++------------------------------------ 1 file changed, 22 insertions(+), 51 deletions(-) diff --git a/test/Jamfile b/test/Jamfile index 462b972..8b911e2 100644 --- a/test/Jamfile +++ b/test/Jamfile @@ -8,55 +8,26 @@ # For more information, see http://www.boost.org/ +import testing ; -subproject libs/lambda/test ; - -# bring in rules for testing -SEARCH on testing.jam = $(BOOST_BUILD_PATH) ; -include testing.jam ; - -# Make tests run by default. -DEPENDS all : test ; - -{ - # look in BOOST_ROOT for sources first, just in this Jamfile - local SEARCH_SOURCE = $(BOOST_ROOT) $(SEARCH_SOURCE) ; - - test-suite lambda - : - [ run libs/lambda/test/algorithm_test.cpp : : : : ] - - [ run libs/lambda/test/bind_tests_simple.cpp : : : : ] - - [ run libs/lambda/test/bind_tests_advanced.cpp : : : : ] - - [ run libs/lambda/test/bind_tests_simple_f_refs.cpp : : : : ] - - [ run libs/lambda/test/bll_and_function.cpp : : : : ] - - [ run libs/lambda/test/cast_test.cpp : : : : ] - - [ run libs/lambda/test/constructor_tests.cpp : : : : ] - - [ run libs/lambda/test/control_structures.cpp : : : : ] - - [ run libs/lambda/test/exception_test.cpp : : : : ] - - [ run libs/lambda/test/extending_rt_traits.cpp : : : : ] - - [ run libs/lambda/test/is_instance_of_test.cpp : : : : ] - - [ run libs/lambda/test/member_pointer_test.cpp : : : : ] - - [ run libs/lambda/test/operator_tests_simple.cpp : : : : ] - - [ run libs/lambda/test/phoenix_control_structures.cpp : : : : ] - - [ run libs/lambda/test/switch_construct.cpp : : : : ] - - [ run libs/lambda/test/rvalue_test.cpp : : : : ] - - [ run libs/lambda/test/istreambuf_test.cpp : : : : ] - ; - -} +project + : requirements /boost/test//boost_test_exec_monitor + ; + +test-suite lambda + : [ run algorithm_test.cpp ] + [ run bind_tests_simple.cpp ] + [ run bind_tests_advanced.cpp ] + [ run bind_tests_simple_f_refs.cpp ] + [ run bll_and_function.cpp ] + [ run cast_test.cpp : : : : lambda_cast_test ] + [ run constructor_tests.cpp ] + [ run control_structures.cpp ] + [ run exception_test.cpp ] + [ run extending_rt_traits.cpp ] + [ run is_instance_of_test.cpp ] + [ run member_pointer_test.cpp ] + [ run operator_tests_simple.cpp ] + [ run phoenix_control_structures.cpp ] + [ run switch_construct.cpp ] + ; From b2dc95bb18860c351c6c98d65f0b4b88846b3f0b Mon Sep 17 00:00:00 2001 From: Marshall Clow Date: Tue, 5 Feb 2008 16:15:35 +0000 Subject: [PATCH 09/42] Applied patch (fixes bug #1307) [SVN r43113] --- doc/lambda.xml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/doc/lambda.xml b/doc/lambda.xml index 21ffcfa..155ce28 100644 --- a/doc/lambda.xml +++ b/doc/lambda.xml @@ -3191,7 +3191,7 @@ to extend the library with new features. - +
Rationale for some of the design decisions
@@ -3256,7 +3256,7 @@ was dropped.
- +
From 1c953ed38c5feef0e54c937b8540e34e85cdb7f8 Mon Sep 17 00:00:00 2001 From: Marshall Clow Date: Sat, 3 May 2008 23:45:30 +0000 Subject: [PATCH 10/42] Updated docs re bug #1855 [SVN r45097] --- doc/lambda.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/doc/lambda.xml b/doc/lambda.xml index 155ce28..fbfeb52 100644 --- a/doc/lambda.xml +++ b/doc/lambda.xml @@ -44,7 +44,7 @@ The Boost Lambda Library (BLL in the sequel) is a C++ template - library, which implements form of lambda abstractions for C++. + library, which implements a form of lambda abstractions for C++. The term originates from functional programming and lambda calculus, where a lambda abstraction defines an unnamed function. The primary motivation for the BLL is to provide flexible and convenient means to define unnamed function objects for STL algorithms. From 2788ede42ab1dbba29b561eec77f33de2cdc1714 Mon Sep 17 00:00:00 2001 From: Beman Dawes Date: Sat, 28 Jun 2008 13:45:21 +0000 Subject: [PATCH 11/42] =?UTF-8?q?With=20his=20kind=20permission,=20change?= =?UTF-8?q?=20Jaakko=20"J=C3=A4rvi"=20to=20"Jarvi"?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit [SVN r46808] --- include/boost/lambda/algorithm.hpp | 2 +- include/boost/lambda/bind.hpp | 2 +- include/boost/lambda/casts.hpp | 2 +- include/boost/lambda/construct.hpp | 2 +- include/boost/lambda/control_structures.hpp | 2 +- include/boost/lambda/core.hpp | 2 +- include/boost/lambda/detail/actions.hpp | 2 +- include/boost/lambda/detail/arity_code.hpp | 2 +- include/boost/lambda/detail/bind_functions.hpp | 2 +- include/boost/lambda/detail/control_constructs_common.hpp | 2 +- include/boost/lambda/detail/control_structures_impl.hpp | 2 +- include/boost/lambda/detail/function_adaptors.hpp | 2 +- include/boost/lambda/detail/is_instance_of.hpp | 2 +- include/boost/lambda/detail/lambda_config.hpp | 2 +- include/boost/lambda/detail/lambda_functor_base.hpp | 2 +- include/boost/lambda/detail/lambda_functors.hpp | 2 +- include/boost/lambda/detail/lambda_fwd.hpp | 2 +- include/boost/lambda/detail/lambda_traits.hpp | 2 +- include/boost/lambda/detail/member_ptr.hpp | 2 +- include/boost/lambda/detail/operator_actions.hpp | 2 +- include/boost/lambda/detail/operator_lambda_func_base.hpp | 2 +- include/boost/lambda/detail/operator_return_type_traits.hpp | 2 +- include/boost/lambda/detail/operators.hpp | 2 +- include/boost/lambda/detail/ret.hpp | 2 +- include/boost/lambda/detail/return_type_traits.hpp | 2 +- include/boost/lambda/detail/select_functions.hpp | 2 +- include/boost/lambda/exceptions.hpp | 2 +- include/boost/lambda/if.hpp | 2 +- include/boost/lambda/lambda.hpp | 2 +- include/boost/lambda/loops.hpp | 2 +- include/boost/lambda/numeric.hpp | 2 +- include/boost/lambda/switch.hpp | 2 +- test/algorithm_test.cpp | 2 +- test/bind_tests_advanced.cpp | 2 +- test/bind_tests_simple.cpp | 2 +- test/bind_tests_simple_f_refs.cpp | 2 +- test/bll_and_function.cpp | 2 +- test/cast_test.cpp | 2 +- test/constructor_tests.cpp | 2 +- test/control_structures.cpp | 2 +- test/exception_test.cpp | 2 +- test/extending_rt_traits.cpp | 2 +- test/is_instance_of_test.cpp | 2 +- test/member_pointer_test.cpp | 2 +- test/operator_tests_simple.cpp | 2 +- test/phoenix_control_structures.cpp | 2 +- test/switch_construct.cpp | 2 +- 47 files changed, 47 insertions(+), 47 deletions(-) diff --git a/include/boost/lambda/algorithm.hpp b/include/boost/lambda/algorithm.hpp index 122942b..ced5f4e 100644 --- a/include/boost/lambda/algorithm.hpp +++ b/include/boost/lambda/algorithm.hpp @@ -1,5 +1,5 @@ // -- algorithm.hpp -- Boost Lambda Library ----------------------------------- -// Copyright (C) 2002 Jaakko Järvi (jaakko.jarvi@cs.utu.fi) +// Copyright (C) 2002 Jaakko Jarvi (jaakko.jarvi@cs.utu.fi) // Copyright (C) 2002 Gary Powell (gwpowell@hotmail.com) // // Distributed under the Boost Software License, Version 1.0. (See diff --git a/include/boost/lambda/bind.hpp b/include/boost/lambda/bind.hpp index 68da0b6..0371393 100644 --- a/include/boost/lambda/bind.hpp +++ b/include/boost/lambda/bind.hpp @@ -1,6 +1,6 @@ // -- bind.hpp -- Boost Lambda Library -------------------------------------- -// Copyright (C) 1999-2001 Jaakko Järvi (jaakko.jarvi@cs.utu.fi) +// Copyright (C) 1999-2001 Jaakko Jarvi (jaakko.jarvi@cs.utu.fi) // Gary Powell (gwpowell@hotmail.com) // // Distributed under the Boost Software License, Version 1.0. (See diff --git a/include/boost/lambda/casts.hpp b/include/boost/lambda/casts.hpp index cf4701c..a5f6856 100644 --- a/include/boost/lambda/casts.hpp +++ b/include/boost/lambda/casts.hpp @@ -1,7 +1,7 @@ // - casts.hpp -- BLambda Library ------------- // // Copyright (C) 2000 Gary Powell (powellg@amazon.com) -// Copyright (C) 1999, 2000 Jaakko Järvi (jaakko.jarvi@cs.utu.fi) +// Copyright (C) 1999, 2000 Jaakko Jarvi (jaakko.jarvi@cs.utu.fi) // // Distributed under the Boost Software License, Version 1.0. (See // accompanying file LICENSE_1_0.txt or copy at diff --git a/include/boost/lambda/construct.hpp b/include/boost/lambda/construct.hpp index b5d5993..f6e5e05 100644 --- a/include/boost/lambda/construct.hpp +++ b/include/boost/lambda/construct.hpp @@ -1,7 +1,7 @@ // - construct.hpp -- Lambda Library ------------- // // Copyright (C) 2000 Gary Powell (powellg@amazon.com) -// Copyright (C) 1999, 2000 Jaakko Järvi (jaakko.jarvi@cs.utu.fi) +// Copyright (C) 1999, 2000 Jaakko Jarvi (jaakko.jarvi@cs.utu.fi) // // Distributed under the Boost Software License, Version 1.0. (See // accompanying file LICENSE_1_0.txt or copy at diff --git a/include/boost/lambda/control_structures.hpp b/include/boost/lambda/control_structures.hpp index fac3642..4164104 100644 --- a/include/boost/lambda/control_structures.hpp +++ b/include/boost/lambda/control_structures.hpp @@ -1,5 +1,5 @@ // -- control_structures.hpp -- Boost Lambda Library -------------------------- -// Copyright (C) 1999, 2000 Jaakko Järvi (jaakko.jarvi@cs.utu.fi) +// Copyright (C) 1999, 2000 Jaakko Jarvi (jaakko.jarvi@cs.utu.fi) // // Distributed under the Boost Software License, Version 1.0. (See // accompanying file LICENSE_1_0.txt or copy at diff --git a/include/boost/lambda/core.hpp b/include/boost/lambda/core.hpp index bcd8149..e42766f 100644 --- a/include/boost/lambda/core.hpp +++ b/include/boost/lambda/core.hpp @@ -1,7 +1,7 @@ // -- core.hpp -- Boost Lambda Library ------------------------------------- // // Copyright (C) 2000 Gary Powell (powellg@amazon.com) -// Copyright (C) 1999, 2000 Jaakko Järvi (jaakko.jarvi@cs.utu.fi) +// Copyright (C) 1999, 2000 Jaakko Jarvi (jaakko.jarvi@cs.utu.fi) // // Distributed under the Boost Software License, Version 1.0. (See // accompanying file LICENSE_1_0.txt or copy at diff --git a/include/boost/lambda/detail/actions.hpp b/include/boost/lambda/detail/actions.hpp index 5464d1a..668799f 100644 --- a/include/boost/lambda/detail/actions.hpp +++ b/include/boost/lambda/detail/actions.hpp @@ -1,6 +1,6 @@ // -- Boost Lambda Library - actions.hpp ---------------------------------- -// Copyright (C) 1999, 2000 Jaakko Järvi (jaakko.jarvi@cs.utu.fi) +// Copyright (C) 1999, 2000 Jaakko Jarvi (jaakko.jarvi@cs.utu.fi) // // Distributed under the Boost Software License, Version 1.0. (See // accompanying file LICENSE_1_0.txt or copy at diff --git a/include/boost/lambda/detail/arity_code.hpp b/include/boost/lambda/detail/arity_code.hpp index 6afd847..bed34b9 100644 --- a/include/boost/lambda/detail/arity_code.hpp +++ b/include/boost/lambda/detail/arity_code.hpp @@ -1,6 +1,6 @@ // -- Boost Lambda Library ------------------------------------------------- -// Copyright (C) 1999, 2000 Jaakko Järvi (jaakko.jarvi@cs.utu.fi) +// Copyright (C) 1999, 2000 Jaakko Jarvi (jaakko.jarvi@cs.utu.fi) // // Distributed under the Boost Software License, Version 1.0. (See // accompanying file LICENSE_1_0.txt or copy at diff --git a/include/boost/lambda/detail/bind_functions.hpp b/include/boost/lambda/detail/bind_functions.hpp index b76507b..f85513c 100644 --- a/include/boost/lambda/detail/bind_functions.hpp +++ b/include/boost/lambda/detail/bind_functions.hpp @@ -1,6 +1,6 @@ // -- bind_functions.hpp -- Boost Lambda Library // -// Copyright (C) 1999, 2000 Jaakko Järvi (jaakko.jarvi@cs.utu.fi) +// Copyright (C) 1999, 2000 Jaakko Jarvi (jaakko.jarvi@cs.utu.fi) // // Distributed under the Boost Software License, Version 1.0. (See // accompanying file LICENSE_1_0.txt or copy at diff --git a/include/boost/lambda/detail/control_constructs_common.hpp b/include/boost/lambda/detail/control_constructs_common.hpp index 4074a85..6826581 100644 --- a/include/boost/lambda/detail/control_constructs_common.hpp +++ b/include/boost/lambda/detail/control_constructs_common.hpp @@ -1,6 +1,6 @@ // Boost Lambda Library -- control_constructs_common.hpp ------------------- -// Copyright (C) 1999, 2000 Jaakko Järvi (jaakko.jarvi@cs.utu.fi) +// Copyright (C) 1999, 2000 Jaakko Jarvi (jaakko.jarvi@cs.utu.fi) // Copyright (C) 2000 Gary Powell (powellg@amazon.com) // // Distributed under the Boost Software License, Version 1.0. (See diff --git a/include/boost/lambda/detail/control_structures_impl.hpp b/include/boost/lambda/detail/control_structures_impl.hpp index fd69fa5..56f80ac 100644 --- a/include/boost/lambda/detail/control_structures_impl.hpp +++ b/include/boost/lambda/detail/control_structures_impl.hpp @@ -1,6 +1,6 @@ // Boost Lambda Library -- control_structures_impl.hpp --------------------- -// Copyright (C) 1999, 2000 Jaakko Järvi (jaakko.jarvi@cs.utu.fi) +// Copyright (C) 1999, 2000 Jaakko Jarvi (jaakko.jarvi@cs.utu.fi) // Copyright (C) 2000 Gary Powell (powellg@amazon.com) // // Distributed under the Boost Software License, Version 1.0. (See diff --git a/include/boost/lambda/detail/function_adaptors.hpp b/include/boost/lambda/detail/function_adaptors.hpp index d0a6acf..c30cbc6 100644 --- a/include/boost/lambda/detail/function_adaptors.hpp +++ b/include/boost/lambda/detail/function_adaptors.hpp @@ -1,6 +1,6 @@ // Boost Lambda Library - function_adaptors.hpp ---------------------------- -// Copyright (C) 1999, 2000 Jaakko Järvi (jaakko.jarvi@cs.utu.fi) +// Copyright (C) 1999, 2000 Jaakko Jarvi (jaakko.jarvi@cs.utu.fi) // // Distributed under the Boost Software License, Version 1.0. (See // accompanying file LICENSE_1_0.txt or copy at diff --git a/include/boost/lambda/detail/is_instance_of.hpp b/include/boost/lambda/detail/is_instance_of.hpp index e8c9fa5..1dfbd43 100644 --- a/include/boost/lambda/detail/is_instance_of.hpp +++ b/include/boost/lambda/detail/is_instance_of.hpp @@ -1,6 +1,6 @@ // Boost Lambda Library - is_instance_of.hpp --------------------- -// Copyright (C) 2001 Jaakko Järvi (jaakko.jarvi@cs.utu.fi) +// Copyright (C) 2001 Jaakko Jarvi (jaakko.jarvi@cs.utu.fi) // // Distributed under the Boost Software License, Version 1.0. (See // accompanying file LICENSE_1_0.txt or copy at diff --git a/include/boost/lambda/detail/lambda_config.hpp b/include/boost/lambda/detail/lambda_config.hpp index c59e3da..9fd1a7b 100644 --- a/include/boost/lambda/detail/lambda_config.hpp +++ b/include/boost/lambda/detail/lambda_config.hpp @@ -1,6 +1,6 @@ // Boost Lambda Library - lambda_config.hpp ------------------------------ -// Copyright (C) 1999, 2000 Jaakko Järvi (jaakko.jarvi@cs.utu.fi) +// Copyright (C) 1999, 2000 Jaakko Jarvi (jaakko.jarvi@cs.utu.fi) // // Distributed under the Boost Software License, Version 1.0. (See // accompanying file LICENSE_1_0.txt or copy at diff --git a/include/boost/lambda/detail/lambda_functor_base.hpp b/include/boost/lambda/detail/lambda_functor_base.hpp index 90f5134..652bdda 100644 --- a/include/boost/lambda/detail/lambda_functor_base.hpp +++ b/include/boost/lambda/detail/lambda_functor_base.hpp @@ -1,6 +1,6 @@ // Boost Lambda Library lambda_functor_base.hpp ----------------------------- // -// Copyright (C) 1999, 2000 Jaakko Järvi (jaakko.jarvi@cs.utu.fi) +// Copyright (C) 1999, 2000 Jaakko Jarvi (jaakko.jarvi@cs.utu.fi) // // Distributed under the Boost Software License, Version 1.0. (See // accompanying file LICENSE_1_0.txt or copy at diff --git a/include/boost/lambda/detail/lambda_functors.hpp b/include/boost/lambda/detail/lambda_functors.hpp index 5f04297..cb6060e 100644 --- a/include/boost/lambda/detail/lambda_functors.hpp +++ b/include/boost/lambda/detail/lambda_functors.hpp @@ -1,6 +1,6 @@ // Boost Lambda Library - lambda_functors.hpp ------------------------------- -// Copyright (C) 1999, 2000 Jaakko Järvi (jaakko.jarvi@cs.utu.fi) +// Copyright (C) 1999, 2000 Jaakko Jarvi (jaakko.jarvi@cs.utu.fi) // // Distributed under the Boost Software License, Version 1.0. (See // accompanying file LICENSE_1_0.txt or copy at diff --git a/include/boost/lambda/detail/lambda_fwd.hpp b/include/boost/lambda/detail/lambda_fwd.hpp index 363c364..a27bfad 100644 --- a/include/boost/lambda/detail/lambda_fwd.hpp +++ b/include/boost/lambda/detail/lambda_fwd.hpp @@ -1,6 +1,6 @@ // lambda_fwd.hpp - Boost Lambda Library ------------------------------- -// Copyright (C) 1999, 2000 Jaakko Järvi (jaakko.jarvi@cs.utu.fi) +// Copyright (C) 1999, 2000 Jaakko Jarvi (jaakko.jarvi@cs.utu.fi) // // Distributed under the Boost Software License, Version 1.0. (See // accompanying file LICENSE_1_0.txt or copy at diff --git a/include/boost/lambda/detail/lambda_traits.hpp b/include/boost/lambda/detail/lambda_traits.hpp index 54180a9..9a3a9b3 100644 --- a/include/boost/lambda/detail/lambda_traits.hpp +++ b/include/boost/lambda/detail/lambda_traits.hpp @@ -1,6 +1,6 @@ // - lambda_traits.hpp --- Boost Lambda Library ---------------------------- // -// Copyright (C) 1999, 2000 Jaakko Järvi (jaakko.jarvi@cs.utu.fi) +// Copyright (C) 1999, 2000 Jaakko Jarvi (jaakko.jarvi@cs.utu.fi) // // Distributed under the Boost Software License, Version 1.0. (See // accompanying file LICENSE_1_0.txt or copy at diff --git a/include/boost/lambda/detail/member_ptr.hpp b/include/boost/lambda/detail/member_ptr.hpp index f2ff22b..288f70c 100644 --- a/include/boost/lambda/detail/member_ptr.hpp +++ b/include/boost/lambda/detail/member_ptr.hpp @@ -1,6 +1,6 @@ // Boost Lambda Library -- member_ptr.hpp --------------------- -// Copyright (C) 1999, 2000 Jaakko Järvi (jaakko.jarvi@cs.utu.fi) +// Copyright (C) 1999, 2000 Jaakko Jarvi (jaakko.jarvi@cs.utu.fi) // Copyright (C) 2000 Gary Powell (gary.powell@sierra.com) // // Distributed under the Boost Software License, Version 1.0. (See diff --git a/include/boost/lambda/detail/operator_actions.hpp b/include/boost/lambda/detail/operator_actions.hpp index 79a0d91..949b40f 100644 --- a/include/boost/lambda/detail/operator_actions.hpp +++ b/include/boost/lambda/detail/operator_actions.hpp @@ -1,6 +1,6 @@ // -- operator_actions.hpp - Boost Lambda Library ---------------------- -// Copyright (C) 1999, 2000 Jaakko Järvi (jaakko.jarvi@cs.utu.fi) +// Copyright (C) 1999, 2000 Jaakko Jarvi (jaakko.jarvi@cs.utu.fi) // // Distributed under the Boost Software License, Version 1.0. (See // accompanying file LICENSE_1_0.txt or copy at diff --git a/include/boost/lambda/detail/operator_lambda_func_base.hpp b/include/boost/lambda/detail/operator_lambda_func_base.hpp index dfa3d2f..12a6d93 100644 --- a/include/boost/lambda/detail/operator_lambda_func_base.hpp +++ b/include/boost/lambda/detail/operator_lambda_func_base.hpp @@ -1,6 +1,6 @@ // Boost Lambda Library - operator_lambda_func_base.hpp ----------------- // -// Copyright (C) 1999, 2000 Jaakko Järvi (jaakko.jarvi@cs.utu.fi) +// Copyright (C) 1999, 2000 Jaakko Jarvi (jaakko.jarvi@cs.utu.fi) // // Distributed under the Boost Software License, Version 1.0. (See // accompanying file LICENSE_1_0.txt or copy at diff --git a/include/boost/lambda/detail/operator_return_type_traits.hpp b/include/boost/lambda/detail/operator_return_type_traits.hpp index 79b422e..913fa86 100644 --- a/include/boost/lambda/detail/operator_return_type_traits.hpp +++ b/include/boost/lambda/detail/operator_return_type_traits.hpp @@ -1,6 +1,6 @@ // operator_return_type_traits.hpp -- Boost Lambda Library ------------------ -// Copyright (C) 1999, 2000 Jaakko Järvi (jaakko.jarvi@cs.utu.fi) +// Copyright (C) 1999, 2000 Jaakko Jarvi (jaakko.jarvi@cs.utu.fi) // // Distributed under the Boost Software License, Version 1.0. (See // accompanying file LICENSE_1_0.txt or copy at diff --git a/include/boost/lambda/detail/operators.hpp b/include/boost/lambda/detail/operators.hpp index cbef4a2..4fdece2 100644 --- a/include/boost/lambda/detail/operators.hpp +++ b/include/boost/lambda/detail/operators.hpp @@ -1,6 +1,6 @@ // Boost Lambda Library - operators.hpp -------------------------------------- -// Copyright (C) 1999, 2000 Jaakko Järvi (jaakko.jarvi@cs.utu.fi) +// Copyright (C) 1999, 2000 Jaakko Jarvi (jaakko.jarvi@cs.utu.fi) // // Distributed under the Boost Software License, Version 1.0. (See // accompanying file LICENSE_1_0.txt or copy at diff --git a/include/boost/lambda/detail/ret.hpp b/include/boost/lambda/detail/ret.hpp index 9f90b6e..fbd8b3a 100644 --- a/include/boost/lambda/detail/ret.hpp +++ b/include/boost/lambda/detail/ret.hpp @@ -1,6 +1,6 @@ // Boost Lambda Library ret.hpp ----------------------------------------- -// Copyright (C) 1999, 2000 Jaakko Järvi (jaakko.jarvi@cs.utu.fi) +// Copyright (C) 1999, 2000 Jaakko Jarvi (jaakko.jarvi@cs.utu.fi) // // Distributed under the Boost Software License, Version 1.0. (See // accompanying file LICENSE_1_0.txt or copy at diff --git a/include/boost/lambda/detail/return_type_traits.hpp b/include/boost/lambda/detail/return_type_traits.hpp index 043a891..d609e52 100644 --- a/include/boost/lambda/detail/return_type_traits.hpp +++ b/include/boost/lambda/detail/return_type_traits.hpp @@ -1,6 +1,6 @@ // return_type_traits.hpp -- Boost Lambda Library --------------------------- -// Copyright (C) 1999, 2000 Jaakko Järvi (jaakko.jarvi@cs.utu.fi) +// Copyright (C) 1999, 2000 Jaakko Jarvi (jaakko.jarvi@cs.utu.fi) // // Distributed under the Boost Software License, Version 1.0. (See // accompanying file LICENSE_1_0.txt or copy at diff --git a/include/boost/lambda/detail/select_functions.hpp b/include/boost/lambda/detail/select_functions.hpp index 9e5e71f..956045c 100644 --- a/include/boost/lambda/detail/select_functions.hpp +++ b/include/boost/lambda/detail/select_functions.hpp @@ -1,6 +1,6 @@ // -- select_functions.hpp -- Boost Lambda Library -------------------------- -// Copyright (C) 1999, 2000 Jaakko Järvi (jaakko.jarvi@cs.utu.fi) +// Copyright (C) 1999, 2000 Jaakko Jarvi (jaakko.jarvi@cs.utu.fi) // // Distributed under the Boost Software License, Version 1.0. (See // accompanying file LICENSE_1_0.txt or copy at diff --git a/include/boost/lambda/exceptions.hpp b/include/boost/lambda/exceptions.hpp index 799ce42..addb275 100644 --- a/include/boost/lambda/exceptions.hpp +++ b/include/boost/lambda/exceptions.hpp @@ -1,7 +1,7 @@ // -- Boost Lambda Library -- exceptions.hpp ---------------- // // Copyright (C) 2000 Gary Powell (gwpowell@hotmail.com) -// Copyright (C) 1999, 2000 Jaakko Järvi (jaakko.jarvi@cs.utu.fi) +// Copyright (C) 1999, 2000 Jaakko Jarvi (jaakko.jarvi@cs.utu.fi) // // Distributed under the Boost Software License, Version 1.0. (See // accompanying file LICENSE_1_0.txt or copy at diff --git a/include/boost/lambda/if.hpp b/include/boost/lambda/if.hpp index aa0bcef..9ee915c 100644 --- a/include/boost/lambda/if.hpp +++ b/include/boost/lambda/if.hpp @@ -1,6 +1,6 @@ // Boost Lambda Library -- if.hpp ------------------------------------------ -// Copyright (C) 1999, 2000 Jaakko Järvi (jaakko.jarvi@cs.utu.fi) +// Copyright (C) 1999, 2000 Jaakko Jarvi (jaakko.jarvi@cs.utu.fi) // Copyright (C) 2000 Gary Powell (powellg@amazon.com) // Copyright (C) 2001-2002 Joel de Guzman // diff --git a/include/boost/lambda/lambda.hpp b/include/boost/lambda/lambda.hpp index c44aa85..75b06c7 100644 --- a/include/boost/lambda/lambda.hpp +++ b/include/boost/lambda/lambda.hpp @@ -1,5 +1,5 @@ // -- lambda.hpp -- Boost Lambda Library ----------------------------------- -// Copyright (C) 1999, 2000 Jaakko Järvi (jaakko.jarvi@cs.utu.fi) +// Copyright (C) 1999, 2000 Jaakko Jarvi (jaakko.jarvi@cs.utu.fi) // // Distributed under the Boost Software License, Version 1.0. (See // accompanying file LICENSE_1_0.txt or copy at diff --git a/include/boost/lambda/loops.hpp b/include/boost/lambda/loops.hpp index fe1021e..4e9b60b 100644 --- a/include/boost/lambda/loops.hpp +++ b/include/boost/lambda/loops.hpp @@ -1,6 +1,6 @@ // Boost Lambda Library -- loops.hpp ---------------------------------------- -// Copyright (C) 1999, 2000 Jaakko Järvi (jaakko.jarvi@cs.utu.fi) +// Copyright (C) 1999, 2000 Jaakko Jarvi (jaakko.jarvi@cs.utu.fi) // Copyright (C) 2000 Gary Powell (powellg@amazon.com) // Copyright (c) 2001-2002 Joel de Guzman // diff --git a/include/boost/lambda/numeric.hpp b/include/boost/lambda/numeric.hpp index 3855602..40a95c7 100644 --- a/include/boost/lambda/numeric.hpp +++ b/include/boost/lambda/numeric.hpp @@ -1,5 +1,5 @@ // -- numeric.hpp -- Boost Lambda Library ----------------------------------- -// Copyright (C) 2002 Jaakko Järvi (jaakko.jarvi@cs.utu.fi) +// Copyright (C) 2002 Jaakko Jarvi (jaakko.jarvi@cs.utu.fi) // Copyright (C) 2002 Gary Powell (gwpowell@hotmail.com) // // Distributed under the Boost Software License, Version 1.0. (See diff --git a/include/boost/lambda/switch.hpp b/include/boost/lambda/switch.hpp index 9a1b3f9..a2c3bad 100644 --- a/include/boost/lambda/switch.hpp +++ b/include/boost/lambda/switch.hpp @@ -1,7 +1,7 @@ // Boost Lambda Library -- switch.hpp ----------------------------------- // // Copyright (C) 2000 Gary Powell (powellg@amazon.com) -// Copyright (C) 1999, 2000 Jaakko Järvi (jaakko.jarvi@cs.utu.fi) +// Copyright (C) 1999, 2000 Jaakko Jarvi (jaakko.jarvi@cs.utu.fi) // // Distributed under the Boost Software License, Version 1.0. (See // accompanying file LICENSE_1_0.txt or copy at diff --git a/test/algorithm_test.cpp b/test/algorithm_test.cpp index 3f52b93..079b771 100644 --- a/test/algorithm_test.cpp +++ b/test/algorithm_test.cpp @@ -1,6 +1,6 @@ // bll_and_function.cpp - The Boost Lambda Library ----------------------- // -// Copyright (C) 2000-2003 Jaakko Järvi (jaakko.jarvi@cs.utu.fi) +// Copyright (C) 2000-2003 Jaakko Jarvi (jaakko.jarvi@cs.utu.fi) // Copyright (C) 2000-2003 Gary Powell (powellg@amazon.com) // // Distributed under the Boost Software License, Version 1.0. (See diff --git a/test/bind_tests_advanced.cpp b/test/bind_tests_advanced.cpp index ae15e08..17afe10 100644 --- a/test/bind_tests_advanced.cpp +++ b/test/bind_tests_advanced.cpp @@ -1,6 +1,6 @@ // bind_tests_advanced.cpp -- The Boost Lambda Library ------------------ // -// Copyright (C) 2000-2003 Jaakko Järvi (jaakko.jarvi@cs.utu.fi) +// Copyright (C) 2000-2003 Jaakko Jarvi (jaakko.jarvi@cs.utu.fi) // Copyright (C) 2000-2003 Gary Powell (powellg@amazon.com) // // Distributed under the Boost Software License, Version 1.0. (See diff --git a/test/bind_tests_simple.cpp b/test/bind_tests_simple.cpp index 59b6f95..c7e273f 100644 --- a/test/bind_tests_simple.cpp +++ b/test/bind_tests_simple.cpp @@ -1,6 +1,6 @@ // bind_tests_simple.cpp -- The Boost Lambda Library ------------------ // -// Copyright (C) 2000-2003 Jaakko Järvi (jaakko.jarvi@cs.utu.fi) +// Copyright (C) 2000-2003 Jaakko Jarvi (jaakko.jarvi@cs.utu.fi) // Copyright (C) 2000-2003 Gary Powell (powellg@amazon.com) // // Distributed under the Boost Software License, Version 1.0. (See diff --git a/test/bind_tests_simple_f_refs.cpp b/test/bind_tests_simple_f_refs.cpp index b2a1d68..9f3b41e 100644 --- a/test/bind_tests_simple_f_refs.cpp +++ b/test/bind_tests_simple_f_refs.cpp @@ -1,6 +1,6 @@ // bind_tests_simple.cpp -- The Boost Lambda Library ------------------ // -// Copyright (C) 2000-2003 Jaakko Järvi (jaakko.jarvi@cs.utu.fi) +// Copyright (C) 2000-2003 Jaakko Jarvi (jaakko.jarvi@cs.utu.fi) // Copyright (C) 2000-2003 Gary Powell (powellg@amazon.com) // // Distributed under the Boost Software License, Version 1.0. (See diff --git a/test/bll_and_function.cpp b/test/bll_and_function.cpp index e638f0a..03bcc3e 100644 --- a/test/bll_and_function.cpp +++ b/test/bll_and_function.cpp @@ -1,6 +1,6 @@ // bll_and_function.cpp - The Boost Lambda Library ----------------------- // -// Copyright (C) 2000-2003 Jaakko Järvi (jaakko.jarvi@cs.utu.fi) +// Copyright (C) 2000-2003 Jaakko Jarvi (jaakko.jarvi@cs.utu.fi) // Copyright (C) 2000-2003 Gary Powell (powellg@amazon.com) // // Distributed under the Boost Software License, Version 1.0. (See diff --git a/test/cast_test.cpp b/test/cast_test.cpp index de1009a..941b42f 100644 --- a/test/cast_test.cpp +++ b/test/cast_test.cpp @@ -1,6 +1,6 @@ // cast_tests.cpp -- The Boost Lambda Library ------------------ // -// Copyright (C) 2000-2003 Jaakko Järvi (jaakko.jarvi@cs.utu.fi) +// Copyright (C) 2000-2003 Jaakko Jarvi (jaakko.jarvi@cs.utu.fi) // Copyright (C) 2000-2003 Gary Powell (powellg@amazon.com) // // Distributed under the Boost Software License, Version 1.0. (See diff --git a/test/constructor_tests.cpp b/test/constructor_tests.cpp index ddd6723..0b77500 100644 --- a/test/constructor_tests.cpp +++ b/test/constructor_tests.cpp @@ -1,6 +1,6 @@ // constructor_tests.cpp -- The Boost Lambda Library ------------------ // -// Copyright (C) 2000-2003 Jaakko Järvi (jaakko.jarvi@cs.utu.fi) +// Copyright (C) 2000-2003 Jaakko Jarvi (jaakko.jarvi@cs.utu.fi) // Copyright (C) 2000-2003 Gary Powell (powellg@amazon.com) // // Distributed under the Boost Software License, Version 1.0. (See diff --git a/test/control_structures.cpp b/test/control_structures.cpp index b46e5ab..12eabf8 100644 --- a/test/control_structures.cpp +++ b/test/control_structures.cpp @@ -1,6 +1,6 @@ // -- control_structures.cpp -- The Boost Lambda Library ------------------ // -// Copyright (C) 2000-2003 Jaakko Järvi (jaakko.jarvi@cs.utu.fi) +// Copyright (C) 2000-2003 Jaakko Jarvi (jaakko.jarvi@cs.utu.fi) // Copyright (C) 2000-2003 Gary Powell (powellg@amazon.com) // // Distributed under the Boost Software License, Version 1.0. (See diff --git a/test/exception_test.cpp b/test/exception_test.cpp index 92fb449..3349fce 100644 --- a/test/exception_test.cpp +++ b/test/exception_test.cpp @@ -1,6 +1,6 @@ // -- exception_test.cpp -- The Boost Lambda Library ------------------ // -// Copyright (C) 2000-2003 Jaakko Järvi (jaakko.jarvi@cs.utu.fi) +// Copyright (C) 2000-2003 Jaakko Jarvi (jaakko.jarvi@cs.utu.fi) // Copyright (C) 2000-2003 Gary Powell (powellg@amazon.com) // // Distributed under the Boost Software License, Version 1.0. (See diff --git a/test/extending_rt_traits.cpp b/test/extending_rt_traits.cpp index 25cae0e..01335a5 100644 --- a/test/extending_rt_traits.cpp +++ b/test/extending_rt_traits.cpp @@ -1,6 +1,6 @@ // extending_return_type_traits.cpp -- The Boost Lambda Library -------- // -// Copyright (C) 2000-2003 Jaakko Järvi (jaakko.jarvi@cs.utu.fi) +// Copyright (C) 2000-2003 Jaakko Jarvi (jaakko.jarvi@cs.utu.fi) // Copyright (C) 2000-2003 Gary Powell (powellg@amazon.com) // // Distributed under the Boost Software License, Version 1.0. (See diff --git a/test/is_instance_of_test.cpp b/test/is_instance_of_test.cpp index a63c525..d1c57b3 100644 --- a/test/is_instance_of_test.cpp +++ b/test/is_instance_of_test.cpp @@ -1,6 +1,6 @@ // is_instance_of_test.cpp -- The Boost Lambda Library ------------------ // -// Copyright (C) 2000-2003 Jaakko Järvi (jaakko.jarvi@cs.utu.fi) +// Copyright (C) 2000-2003 Jaakko Jarvi (jaakko.jarvi@cs.utu.fi) // Copyright (C) 2000-2003 Gary Powell (powellg@amazon.com) // // Distributed under the Boost Software License, Version 1.0. (See diff --git a/test/member_pointer_test.cpp b/test/member_pointer_test.cpp index 3efca05..802e991 100644 --- a/test/member_pointer_test.cpp +++ b/test/member_pointer_test.cpp @@ -1,6 +1,6 @@ // member_pointer_test.cpp -- The Boost Lambda Library ------------------ // -// Copyright (C) 2000-2003 Jaakko Järvi (jaakko.jarvi@cs.utu.fi) +// Copyright (C) 2000-2003 Jaakko Jarvi (jaakko.jarvi@cs.utu.fi) // Copyright (C) 2000-2003 Gary Powell (powellg@amazon.com) // // Distributed under the Boost Software License, Version 1.0. (See diff --git a/test/operator_tests_simple.cpp b/test/operator_tests_simple.cpp index 163b8d5..d440fed 100644 --- a/test/operator_tests_simple.cpp +++ b/test/operator_tests_simple.cpp @@ -1,6 +1,6 @@ // operator_tests_simple.cpp -- The Boost Lambda Library --------------- // -// Copyright (C) 2000-2003 Jaakko Järvi (jaakko.jarvi@cs.utu.fi) +// Copyright (C) 2000-2003 Jaakko Jarvi (jaakko.jarvi@cs.utu.fi) // Copyright (C) 2000-2003 Gary Powell (powellg@amazon.com) // // Distributed under the Boost Software License, Version 1.0. (See diff --git a/test/phoenix_control_structures.cpp b/test/phoenix_control_structures.cpp index 7dc1333..722a74f 100644 --- a/test/phoenix_control_structures.cpp +++ b/test/phoenix_control_structures.cpp @@ -1,6 +1,6 @@ // phoenix_style_control_structures.cpp -- The Boost Lambda Library ------ // -// Copyright (C) 2000-2003 Jaakko Järvi (jaakko.jarvi@cs.utu.fi) +// Copyright (C) 2000-2003 Jaakko Jarvi (jaakko.jarvi@cs.utu.fi) // Copyright (C) 2000-2003 Gary Powell (powellg@amazon.com) // // Distributed under the Boost Software License, Version 1.0. (See diff --git a/test/switch_construct.cpp b/test/switch_construct.cpp index 89ed8c7..a0599fe 100644 --- a/test/switch_construct.cpp +++ b/test/switch_construct.cpp @@ -1,6 +1,6 @@ // switch_test.cpp -- The Boost Lambda Library -------------------------- // -// Copyright (C) 2000-2003 Jaakko Järvi (jaakko.jarvi@cs.utu.fi) +// Copyright (C) 2000-2003 Jaakko Jarvi (jaakko.jarvi@cs.utu.fi) // Copyright (C) 2000-2003 Gary Powell (powellg@amazon.com) // // Distributed under the Boost Software License, Version 1.0. (See From d56abd61ce1a00a3e271e5eed2bafecfcbb47ef0 Mon Sep 17 00:00:00 2001 From: "Michael A. Jackson" Date: Sat, 1 Nov 2008 13:15:41 +0000 Subject: [PATCH 12/42] Continuing merge of CMake build system files into trunk with the encouragement of Doug Gregor [SVN r49510] --- CMakeLists.txt | 21 +++++++++++++++++++++ test/CMakeLists.txt | 16 ++++++++++++++++ 2 files changed, 37 insertions(+) create mode 100644 CMakeLists.txt create mode 100644 test/CMakeLists.txt diff --git a/CMakeLists.txt b/CMakeLists.txt new file mode 100644 index 0000000..c822430 --- /dev/null +++ b/CMakeLists.txt @@ -0,0 +1,21 @@ +#---------------------------------------------------------------------------- +# This file was automatically generated from the original CMakeLists.txt file +# Add a variable to hold the headers for the library +set (lib_headers + lambda +) + +# Add a library target to the build system +boost_library_project( + lambda + # SRCDIRS + TESTDIRS test + HEADERS ${lib_headers} + # DOCDIRS + # DESCRIPTION + MODULARIZED + # AUTHORS + # MAINTAINERS +) + + diff --git a/test/CMakeLists.txt b/test/CMakeLists.txt new file mode 100644 index 0000000..d6ef72e --- /dev/null +++ b/test/CMakeLists.txt @@ -0,0 +1,16 @@ +boost_test_run(algorithm_test DEPENDS boost_test_exec_monitor) +boost_test_run(bind_tests_simple DEPENDS boost_test_exec_monitor) +boost_test_run(bind_tests_advanced DEPENDS boost_test_exec_monitor) +boost_test_run(bind_tests_simple_f_refs DEPENDS boost_test_exec_monitor) +boost_test_run(bll_and_function DEPENDS boost_test_exec_monitor) +boost_test_run(lambda_cast_test + cast_test.cpp DEPENDS boost_test_exec_monitor) +boost_test_run(constructor_tests DEPENDS boost_test_exec_monitor) +boost_test_run(control_structures DEPENDS boost_test_exec_monitor) +boost_test_run(exception_test DEPENDS boost_test_exec_monitor) +boost_test_run(extending_rt_traits DEPENDS boost_test_exec_monitor) +boost_test_run(is_instance_of_test DEPENDS boost_test_exec_monitor) +boost_test_run(member_pointer_test DEPENDS boost_test_exec_monitor) +boost_test_run(operator_tests_simple DEPENDS boost_test_exec_monitor) +boost_test_run(phoenix_control_structures DEPENDS boost_test_exec_monitor) +boost_test_run(switch_construct DEPENDS boost_test_exec_monitor) From ec350abf0605aa25f19f6620a623ea025a7ccc66 Mon Sep 17 00:00:00 2001 From: "Michael A. Jackson" Date: Fri, 7 Nov 2008 17:02:56 +0000 Subject: [PATCH 13/42] Updating CMake files to latest trunk. Added dependency information for regression tests and a few new macros for internal use. [SVN r49627] --- test/CMakeLists.txt | 2 ++ 1 file changed, 2 insertions(+) diff --git a/test/CMakeLists.txt b/test/CMakeLists.txt index d6ef72e..ae75a2b 100644 --- a/test/CMakeLists.txt +++ b/test/CMakeLists.txt @@ -1,3 +1,5 @@ +boost_additional_test_dependencies(lambda BOOST_DEPENDS test any) + boost_test_run(algorithm_test DEPENDS boost_test_exec_monitor) boost_test_run(bind_tests_simple DEPENDS boost_test_exec_monitor) boost_test_run(bind_tests_advanced DEPENDS boost_test_exec_monitor) From 48a89b7705e7040eeb7fce845fed6853f2b92726 Mon Sep 17 00:00:00 2001 From: "Michael A. Jackson" Date: Fri, 7 Nov 2008 17:05:27 +0000 Subject: [PATCH 14/42] Updating dependency information for modularized libraries. [SVN r49628] --- module.cmake | 1 + 1 file changed, 1 insertion(+) create mode 100644 module.cmake diff --git a/module.cmake b/module.cmake new file mode 100644 index 0000000..9f7a073 --- /dev/null +++ b/module.cmake @@ -0,0 +1 @@ +boost_module(lambda DEPENDS tuple) \ No newline at end of file From cd3d5fd03a14318dc5d3b853a3e2d944e0864498 Mon Sep 17 00:00:00 2001 From: Marshall Clow Date: Tue, 30 Dec 2008 18:27:43 +0000 Subject: [PATCH 15/42] Typo: fixes bug #2583 [SVN r50413] --- doc/lambda.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/doc/lambda.xml b/doc/lambda.xml index fbfeb52..4ad5957 100644 --- a/doc/lambda.xml +++ b/doc/lambda.xml @@ -1908,7 +1908,7 @@ For example: int foo(int); int bar(int); ... int i; -bind(foo, bind(bar, _1)(i); +bind(foo, bind(bar, _1))(i);
The last line makes the call foo(bar(i)); From d5a98758fa903eeea10f4401053d808cb64ef911 Mon Sep 17 00:00:00 2001 From: Steven Watanabe Date: Thu, 8 Jan 2009 16:58:48 +0000 Subject: [PATCH 16/42] Add specializations of plain_return_type_2 for std::string. Fixes #781 [SVN r50516] --- .../detail/operator_return_type_traits.hpp | 35 +++++++++++++++++++ include/boost/lambda/detail/operators.hpp | 26 +++++++------- 2 files changed, 48 insertions(+), 13 deletions(-) diff --git a/include/boost/lambda/detail/operator_return_type_traits.hpp b/include/boost/lambda/detail/operator_return_type_traits.hpp index 913fa86..4f6a84f 100644 --- a/include/boost/lambda/detail/operator_return_type_traits.hpp +++ b/include/boost/lambda/detail/operator_return_type_traits.hpp @@ -933,6 +933,41 @@ struct plain_return_type_2, const std::basic_stri typedef typename std::basic_string::const_reference type; }; +template +struct plain_return_type_2, + std::basic_string, + std::basic_string > { + typedef std::basic_string type; +}; + +template +struct plain_return_type_2, + const Char*, + std::basic_string > { + typedef std::basic_string type; +}; + +template +struct plain_return_type_2, + std::basic_string, + const Char*> { + typedef std::basic_string type; +}; + +template +struct plain_return_type_2, + Char[N], + std::basic_string > { + typedef std::basic_string type; +}; + +template +struct plain_return_type_2, + std::basic_string, + Char[N]> { + typedef std::basic_string type; +}; + } // namespace lambda } // namespace boost diff --git a/include/boost/lambda/detail/operators.hpp b/include/boost/lambda/detail/operators.hpp index 4fdece2..29eb106 100644 --- a/include/boost/lambda/detail/operators.hpp +++ b/include/boost/lambda/detail/operators.hpp @@ -258,17 +258,17 @@ operator>>(const lambda_functor& a, Ret(&b)(ManipArg)) #error "Multiple defines of BOOST_LAMBDA_PTR_ARITHMETIC_E1" #endif -#define BOOST_LAMBDA_PTR_ARITHMETIC_E1(OPER_NAME, ACTION, CONSTB) \ +#define BOOST_LAMBDA_PTR_ARITHMETIC_E1(OPER_NAME, ACTION, CONSTB) \ template \ inline const \ lambda_functor< \ - lambda_functor_base, CONSTB(&)[N]> > \ + lambda_functor_base, CONSTB(&)[N]> > \ > \ -OPER_NAME (const lambda_functor& a, CONSTB(&b)[N]) \ +OPER_NAME (const lambda_functor& a, CONSTB(&b)[N]) \ { \ - return lambda_functor< \ - lambda_functor_base, CONSTB(&)[N]> > \ - >(tuple, CONSTB(&)[N]>(a, b)); \ + return \ + lambda_functor_base, CONSTB(&)[N]> > \ + (tuple, CONSTB(&)[N]>(a, b)); \ } @@ -276,15 +276,15 @@ OPER_NAME (const lambda_functor& a, CONSTB(&b)[N]) \ #error "Multiple defines of BOOST_LAMBDA_PTR_ARITHMETIC_E2" #endif -#define BOOST_LAMBDA_PTR_ARITHMETIC_E2(OPER_NAME, ACTION, CONSTA) \ -template \ -inline const \ -lambda_functor< \ +#define BOOST_LAMBDA_PTR_ARITHMETIC_E2(OPER_NAME, ACTION, CONSTA) \ +template \ +inline const \ +lambda_functor< \ lambda_functor_base > > \ -> \ +> \ OPER_NAME (CONSTA(&a)[N], const lambda_functor& b) \ -{ \ - return \ +{ \ + return \ lambda_functor_base > > \ (tuple >(a, b)); \ } From 150736273e905da22bf38ac61da5e63f11ac6320 Mon Sep 17 00:00:00 2001 From: Steven Watanabe Date: Tue, 3 Feb 2009 21:47:58 +0000 Subject: [PATCH 17/42] Add on. Fixes #2446 [SVN r50999] --- test/Jamfile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/test/Jamfile b/test/Jamfile index 8b911e2..99a9757 100644 --- a/test/Jamfile +++ b/test/Jamfile @@ -11,7 +11,7 @@ import testing ; project - : requirements /boost/test//boost_test_exec_monitor + : requirements msvc:on ; test-suite lambda From 0faeb3f19e699896d2ae2905456655189637958b Mon Sep 17 00:00:00 2001 From: John Maddock Date: Sun, 8 Feb 2009 16:59:14 +0000 Subject: [PATCH 18/42] Add Jamfile to build PDF versions of all the docs. Tweaked some existing Jamfiles so that PDF build finds all the necessary image files etc. Tweaked fo.xsl to provide more options by default, and improve formatting. [SVN r51104] --- doc/Jamfile.v2 | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/doc/Jamfile.v2 b/doc/Jamfile.v2 index e04ba91..36f3fcf 100644 --- a/doc/Jamfile.v2 +++ b/doc/Jamfile.v2 @@ -1,5 +1,11 @@ project boost/doc ; import boostbook : boostbook ; -boostbook lambda-doc : lambda.xml ; +# Are these really the correct images?? +path-constant images : ../../spirit/phoenix/doc/html ; + +boostbook lambda-doc : lambda.xml +: + pdf:img.src.path=$(images)/ +; From 0c4e251ebee2d497c958ec509b2ca664c61e4610 Mon Sep 17 00:00:00 2001 From: Steven Watanabe Date: Thu, 26 Feb 2009 02:33:15 +0000 Subject: [PATCH 19/42] Supress warnings on gcc and msvc. Fixes #1515 [SVN r51448] --- include/boost/lambda/casts.hpp | 5 +- .../lambda/detail/lambda_functor_base.hpp | 10 +++- .../boost/lambda/detail/lambda_functors.hpp | 8 ++- include/boost/lambda/detail/lambda_traits.hpp | 50 +++++++++++++++++++ .../detail/operator_return_type_traits.hpp | 17 ++++--- .../boost/lambda/detail/suppress_unused.hpp | 27 ++++++++++ include/boost/lambda/switch.hpp | 8 ++- test/constructor_tests.cpp | 8 ++- test/exception_test.cpp | 4 +- test/extending_rt_traits.cpp | 18 +++++-- test/member_pointer_test.cpp | 4 +- test/operator_tests_simple.cpp | 4 ++ 12 files changed, 142 insertions(+), 21 deletions(-) create mode 100644 include/boost/lambda/detail/suppress_unused.hpp diff --git a/include/boost/lambda/casts.hpp b/include/boost/lambda/casts.hpp index a5f6856..29437a8 100644 --- a/include/boost/lambda/casts.hpp +++ b/include/boost/lambda/casts.hpp @@ -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 @@ public: } }; - // typedid action +// typeid action class typeid_action { public: template static RET apply(Arg1 &a1) { + detail::suppress_unused_variable_warnings(a1); return typeid(a1); } }; diff --git a/include/boost/lambda/detail/lambda_functor_base.hpp b/include/boost/lambda/detail/lambda_functor_base.hpp index 652bdda..6a43c14 100644 --- a/include/boost/lambda/detail/lambda_functor_base.hpp +++ b/include/boost/lambda/detail/lambda_functor_base.hpp @@ -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 @@ public: 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 @@ class lambda_functor_base, Args> { 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; diff --git a/include/boost/lambda/detail/lambda_functors.hpp b/include/boost/lambda/detail/lambda_functors.hpp index cb6060e..913ccef 100644 --- a/include/boost/lambda/detail/lambda_functors.hpp +++ b/include/boost/lambda/detail/lambda_functors.hpp @@ -105,7 +105,10 @@ typedef const lambda_functor > placeholder3_type; // 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 @@ -244,6 +247,9 @@ public: } }; +#if BOOST_WORKAROUND(BOOST_MSVC, >= 1400) +#pragma warning(pop) +#endif } // namespace lambda } // namespace boost diff --git a/include/boost/lambda/detail/lambda_traits.hpp b/include/boost/lambda/detail/lambda_traits.hpp index 9a3a9b3..0e683c2 100644 --- a/include/boost/lambda/detail/lambda_traits.hpp +++ b/include/boost/lambda/detail/lambda_traits.hpp @@ -430,6 +430,56 @@ struct bind_traits { 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; diff --git a/include/boost/lambda/detail/operator_return_type_traits.hpp b/include/boost/lambda/detail/operator_return_type_traits.hpp index 4f6a84f..3d3ac96 100644 --- a/include/boost/lambda/detail/operator_return_type_traits.hpp +++ b/include/boost/lambda/detail/operator_return_type_traits.hpp @@ -233,28 +233,31 @@ template struct contentsof_type { // 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; }; diff --git a/include/boost/lambda/detail/suppress_unused.hpp b/include/boost/lambda/detail/suppress_unused.hpp new file mode 100644 index 0000000..43999f1 --- /dev/null +++ b/include/boost/lambda/detail/suppress_unused.hpp @@ -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 diff --git a/include/boost/lambda/switch.hpp b/include/boost/lambda/switch.hpp index a2c3bad..05d02e9 100644 --- a/include/boost/lambda/switch.hpp +++ b/include/boost/lambda/switch.hpp @@ -465,12 +465,18 @@ BOOST_LAMBDA_SWITCH( BOOST_PP_INC(N) ) #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 diff --git a/test/constructor_tests.cpp b/test/constructor_tests.cpp index 0b77500..73034d1 100644 --- a/test/constructor_tests.cpp +++ b/test/constructor_tests.cpp @@ -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 @@ bool check_tuple(int n, const T& t) } 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 @@ public: 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); diff --git a/test/exception_test.cpp b/test/exception_test.cpp index 3349fce..ee90666 100644 --- a/test/exception_test.cpp +++ b/test/exception_test.cpp @@ -29,7 +29,7 @@ using namespace boost::lambda; 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 @@ int test_main(int, char *[]) { return_type_matching(); test_empty_catch_blocks(); } - catch (int x) + catch (int) { BOOST_CHECK(false); } diff --git a/test/extending_rt_traits.cpp b/test/extending_rt_traits.cpp index 01335a5..56916ab 100644 --- a/test/extending_rt_traits.cpp +++ b/test/extending_rt_traits.cpp @@ -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 @@ struct plain_return_type_1, A> { } // lambda } // boost -void ok(B b) {} +void ok(B /*b*/) {} void test_unary_operators() { @@ -127,7 +130,7 @@ class my_vector {}; 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 @@ Z operator^=( X&, const Y&) { return Z(); } // 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 @@ void test_binary_operators() { 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); diff --git a/test/member_pointer_test.cpp b/test/member_pointer_test.cpp index 802e991..e8121d5 100644 --- a/test/member_pointer_test.cpp +++ b/test/member_pointer_test.cpp @@ -118,11 +118,11 @@ class C {}; 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; } diff --git a/test/operator_tests_simple.cpp b/test/operator_tests_simple.cpp index d440fed..78eae51 100644 --- a/test/operator_tests_simple.cpp +++ b/test/operator_tests_simple.cpp @@ -17,6 +17,8 @@ #include "boost/lambda/lambda.hpp" +#include "boost/lambda/detail/suppress_unused.hpp" + #include #include #include @@ -96,6 +98,8 @@ void arithmetic_operators() { // 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() { From 04ae944c3ceecad6746d30f0d9412b362e8d95e8 Mon Sep 17 00:00:00 2001 From: Steven Watanabe Date: Sun, 17 May 2009 00:25:06 +0000 Subject: [PATCH 20/42] Avoid using namespace std; to prevent ambiguity between boost and std components. Fixes #3025 [SVN r53061] --- test/constructor_tests.cpp | 23 +++++++++++------------ 1 file changed, 11 insertions(+), 12 deletions(-) diff --git a/test/constructor_tests.cpp b/test/constructor_tests.cpp index 73034d1..1ab4102 100644 --- a/test/constructor_tests.cpp +++ b/test/constructor_tests.cpp @@ -29,7 +29,6 @@ #endif using namespace boost::lambda; -using namespace std; template bool check_tuple(int n, const T& t) @@ -212,17 +211,17 @@ int count_deletes::count = 0; void test_news_and_deletes () { int* i[10]; - for_each(i, i+10, _1 = bind(new_ptr(), 2)); + std::for_each(i, i+10, _1 = bind(new_ptr(), 2)); int count_errors = 0; - for_each(i, i+10, (*_1 == 2) || ++var(count_errors)); + std::for_each(i, i+10, (*_1 == 2) || ++var(count_errors)); BOOST_CHECK(count_errors == 0); count_deletes* ct[10]; - for_each(ct, ct+10, _1 = bind(new_ptr())); + std::for_each(ct, ct+10, _1 = bind(new_ptr())); count_deletes::count = 0; - for_each(ct, ct+10, bind(delete_ptr(), _1)); + std::for_each(ct, ct+10, bind(delete_ptr(), _1)); BOOST_CHECK(count_deletes::count == 10); } @@ -240,16 +239,16 @@ void test_array_new_and_delete() void delayed_construction() { - vector x(3); - vector y(3); + std::vector x(3); + std::vector y(3); - fill(x.begin(), x.end(), 0); - fill(y.begin(), y.end(), 1); + std::fill(x.begin(), x.end(), 0); + std::fill(y.begin(), y.end(), 1); - vector > v; + std::vector > v; - transform(x.begin(), x.end(), y.begin(), back_inserter(v), - bind(constructor >(), _1, _2) ); + std::transform(x.begin(), x.end(), y.begin(), std::back_inserter(v), + bind(constructor >(), _1, _2) ); } int test_main(int, char *[]) { From 6985fca6eecae4305d75ebd135b16c984a9262bd Mon Sep 17 00:00:00 2001 From: Steven Watanabe Date: Sun, 24 May 2009 22:58:52 +0000 Subject: [PATCH 21/42] Avoid ambiguities between boost::lambda::bind and std::bind with VC10. Fixes #3075 [SVN r53233] --- test/bind_tests_advanced.cpp | 9 +++++---- test/bind_tests_simple.cpp | 4 +--- test/bind_tests_simple_f_refs.cpp | 4 +--- test/constructor_tests.cpp | 3 ++- 4 files changed, 9 insertions(+), 11 deletions(-) diff --git a/test/bind_tests_advanced.cpp b/test/bind_tests_advanced.cpp index 17afe10..a891f91 100644 --- a/test/bind_tests_advanced.cpp +++ b/test/bind_tests_advanced.cpp @@ -27,7 +27,8 @@ #include -using namespace boost::lambda; +using namespace boost::lambda; +namespace bl = boost::lambda; int sum_0() { return 0; } int sum_1(int a) { return a; } @@ -91,7 +92,7 @@ int call_with_100(const F& f) { // This would result in; // bind(_1 + 1, _1)(make_const(100)) , which would be a compile time error - return bind(unlambda(f), _1)(make_const(100)); + return bl::bind(unlambda(f), _1)(make_const(100)); // for other functors than lambda functors, unlambda has no effect // (except for making them const) @@ -116,11 +117,11 @@ void test_unlambda() { BOOST_CHECK(call_with_101(_1 + 1) == 102); - BOOST_CHECK(call_with_100(bind(std_functor(std::bind1st(std::plus(), 1)), _1)) == 101); + BOOST_CHECK(call_with_100(bl::bind(std_functor(std::bind1st(std::plus(), 1)), _1)) == 101); // std_functor insturcts LL that the functor defines a result_type typedef // rather than a sig template. - bind(std_functor(std::plus()), _1, _2)(i, i); + bl::bind(std_functor(std::plus()), _1, _2)(i, i); } diff --git a/test/bind_tests_simple.cpp b/test/bind_tests_simple.cpp index c7e273f..d9a05fa 100644 --- a/test/bind_tests_simple.cpp +++ b/test/bind_tests_simple.cpp @@ -18,9 +18,7 @@ #include - - using namespace std; - using namespace boost::lambda; +using namespace boost::lambda; int sum_of_args_0() { return 0; } diff --git a/test/bind_tests_simple_f_refs.cpp b/test/bind_tests_simple_f_refs.cpp index 9f3b41e..df601d7 100644 --- a/test/bind_tests_simple_f_refs.cpp +++ b/test/bind_tests_simple_f_refs.cpp @@ -18,9 +18,7 @@ #include - - using namespace std; - using namespace boost::lambda; +using namespace boost::lambda; int sum_of_args_0() { return 0; } diff --git a/test/constructor_tests.cpp b/test/constructor_tests.cpp index 1ab4102..8cef0cb 100644 --- a/test/constructor_tests.cpp +++ b/test/constructor_tests.cpp @@ -29,6 +29,7 @@ #endif using namespace boost::lambda; +namespace bl = boost::lambda; template bool check_tuple(int n, const T& t) @@ -248,7 +249,7 @@ void delayed_construction() std::vector > v; std::transform(x.begin(), x.end(), y.begin(), std::back_inserter(v), - bind(constructor >(), _1, _2) ); + bl::bind(constructor >(), _1, _2) ); } int test_main(int, char *[]) { From 9a8e5d778409d34472e850039b1060e4632a0a7f Mon Sep 17 00:00:00 2001 From: Steven Watanabe Date: Mon, 25 May 2009 21:52:12 +0000 Subject: [PATCH 22/42] Fix lambda regression with msvc 7.1 [SVN r53261] --- .../boost/lambda/detail/lambda_functors.hpp | 34 ++++++++++++++++--- 1 file changed, 29 insertions(+), 5 deletions(-) diff --git a/include/boost/lambda/detail/lambda_functors.hpp b/include/boost/lambda/detail/lambda_functors.hpp index 913ccef..993479e 100644 --- a/include/boost/lambda/detail/lambda_functors.hpp +++ b/include/boost/lambda/detail/lambda_functors.hpp @@ -13,6 +13,30 @@ #ifndef BOOST_LAMBDA_LAMBDA_FUNCTORS_HPP #define BOOST_LAMBDA_LAMBDA_FUNCTORS_HPP +#include +#include + +#if BOOST_WORKAROUND(BOOST_MSVC, == 1310) + +#include +#include +#include + +#define BOOST_LAMBDA_DISABLE_IF_ARRAY1(A1, R1)\ + typename lazy_disable_if, typename R1 >::type +#define BOOST_LAMBDA_DISABLE_IF_ARRAY2(A1, A2, R1, R2) \ + typename lazy_disable_if, is_array >, typename R1, R2 >::type +#define BOOST_LAMBDA_DISABLE_IF_ARRAY3(A1, A2, A3, R1, R2, R3) \ + typename lazy_disable_if, is_array, is_array >, typename R1, R2, R3 >::type + +#else + +#define BOOST_LAMBDA_DISABLE_IF_ARRAY1(A1, R1) typename R1::type +#define BOOST_LAMBDA_DISABLE_IF_ARRAY2(A1, A2, R1, R2) typename R1, R2::type +#define BOOST_LAMBDA_DISABLE_IF_ARRAY3(A1, A2, A3, R1, R2, R3) typename R1, R2, R3::type + +#endif + namespace boost { namespace lambda { @@ -152,7 +176,7 @@ public: } template - typename inherited::template sig >::type + BOOST_LAMBDA_DISABLE_IF_ARRAY1(A, inherited::template sig >) operator()(A const& a) const { return inherited::template call< typename inherited::template sig >::type @@ -168,7 +192,7 @@ public: } template - typename inherited::template sig >::type + BOOST_LAMBDA_DISABLE_IF_ARRAY2(A, B, inherited::template sig >) operator()(A const& a, B& b) const { return inherited::template call< typename inherited::template sig >::type @@ -176,7 +200,7 @@ public: } template - typename inherited::template sig >::type + BOOST_LAMBDA_DISABLE_IF_ARRAY2(A, B, inherited::template sig >) operator()(A& a, B const& b) const { return inherited::template call< typename inherited::template sig >::type @@ -184,7 +208,7 @@ public: } template - typename inherited::template sig >::type + BOOST_LAMBDA_DISABLE_IF_ARRAY2(A, B, inherited::template sig >) operator()(A const& a, B const& b) const { return inherited::template call< typename inherited::template sig >::type @@ -201,7 +225,7 @@ public: } template - typename inherited::template sig >::type + BOOST_LAMBDA_DISABLE_IF_ARRAY3(A, B, C, inherited::template sig >) operator()(A const& a, B const& b, C const& c) const { return inherited::template call< From 0f6005508603e4865fcbff82ad9799ed6af63ae5 Mon Sep 17 00:00:00 2001 From: Jeremiah Willcock Date: Thu, 28 May 2009 14:49:25 +0000 Subject: [PATCH 23/42] Fixed tabs [SVN r53343] --- include/boost/lambda/detail/lambda_functors.hpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/include/boost/lambda/detail/lambda_functors.hpp b/include/boost/lambda/detail/lambda_functors.hpp index 993479e..5187c7d 100644 --- a/include/boost/lambda/detail/lambda_functors.hpp +++ b/include/boost/lambda/detail/lambda_functors.hpp @@ -23,11 +23,11 @@ #include #define BOOST_LAMBDA_DISABLE_IF_ARRAY1(A1, R1)\ - typename lazy_disable_if, typename R1 >::type + typename lazy_disable_if, typename R1 >::type #define BOOST_LAMBDA_DISABLE_IF_ARRAY2(A1, A2, R1, R2) \ - typename lazy_disable_if, is_array >, typename R1, R2 >::type + typename lazy_disable_if, is_array >, typename R1, R2 >::type #define BOOST_LAMBDA_DISABLE_IF_ARRAY3(A1, A2, A3, R1, R2, R3) \ - typename lazy_disable_if, is_array, is_array >, typename R1, R2, R3 >::type + typename lazy_disable_if, is_array, is_array >, typename R1, R2, R3 >::type #else From 41eb864595ee66f6cdaeeed64460cdfc858dd2a4 Mon Sep 17 00:00:00 2001 From: Steven Watanabe Date: Fri, 5 Jun 2009 01:20:06 +0000 Subject: [PATCH 24/42] Add result_type to lambda::ret. Fixes #1222 [SVN r53648] --- .../lambda/detail/lambda_functor_base.hpp | 2 + test/Jamfile | 1 + test/ret_test.cpp | 53 +++++++++++++++++++ 3 files changed, 56 insertions(+) create mode 100644 test/ret_test.cpp diff --git a/include/boost/lambda/detail/lambda_functor_base.hpp b/include/boost/lambda/detail/lambda_functor_base.hpp index 6a43c14..e5bb02a 100644 --- a/include/boost/lambda/detail/lambda_functor_base.hpp +++ b/include/boost/lambda/detail/lambda_functor_base.hpp @@ -270,6 +270,8 @@ class lambda_functor_base, Args> public: Args args; + typedef RET result_type; + explicit lambda_functor_base(const Args& a) : args(a) {} template struct sig { typedef RET type; }; diff --git a/test/Jamfile b/test/Jamfile index 99a9757..4080eb3 100644 --- a/test/Jamfile +++ b/test/Jamfile @@ -30,4 +30,5 @@ test-suite lambda [ run operator_tests_simple.cpp ] [ run phoenix_control_structures.cpp ] [ run switch_construct.cpp ] + [ run ret_test.cpp ] ; diff --git a/test/ret_test.cpp b/test/ret_test.cpp new file mode 100644 index 0000000..82c947f --- /dev/null +++ b/test/ret_test.cpp @@ -0,0 +1,53 @@ +// ret_test.cpp - The Boost Lambda Library ----------------------- +// +// 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 + +#include + +#include + +#include +#include + +template +void test_ret(R r, F f) { + typename F::result_type x = f(); + BOOST_MPL_ASSERT((boost::is_same)); + BOOST_CHECK(x == r); +} + +template +void test_ret(R r, F f, T1& t1) { + typename F::result_type x = f(t1); + BOOST_MPL_ASSERT((boost::is_same)); + BOOST_CHECK(x == r); +} + +class add_result { +public: + add_result(int i = 0) : value(i) {} + friend bool operator==(const add_result& lhs, const add_result& rhs) { + return(lhs.value == rhs.value); + } +private: + int value; +}; + +class addable {}; +add_result operator+(addable, addable) { + return add_result(7); +} + +int test_main(int, char*[]) { + addable test; + test_ret(add_result(7), boost::lambda::ret(boost::lambda::_1 + test), test); + test_ret(8.0, boost::lambda::ret(boost::lambda::constant(7) + 1)); + + return 0; +} From 1afc4b677998d1de135a3fb43f32d9fb2d6baad7 Mon Sep 17 00:00:00 2001 From: Steven Watanabe Date: Fri, 5 Jun 2009 01:43:39 +0000 Subject: [PATCH 25/42] Use boost/detail/container_fwd.hpp. Fixes #2601 [SVN r53649] --- .../detail/operator_return_type_traits.hpp | 43 +------------------ 1 file changed, 1 insertion(+), 42 deletions(-) diff --git a/include/boost/lambda/detail/operator_return_type_traits.hpp b/include/boost/lambda/detail/operator_return_type_traits.hpp index 3d3ac96..d13af91 100644 --- a/include/boost/lambda/detail/operator_return_type_traits.hpp +++ b/include/boost/lambda/detail/operator_return_type_traits.hpp @@ -15,6 +15,7 @@ #include "boost/type_traits/same_traits.hpp" #include "boost/indirect_reference.hpp" +#include "boost/detail/container_fwd.hpp" #include // needed for the ptrdiff_t #include // for istream and ostream @@ -58,10 +59,6 @@ template <> struct promote_code { static const int value = 700; }; } // namespace lambda } // namespace boost -namespace std { - template class complex; -} - namespace boost { namespace lambda { namespace detail { @@ -856,44 +853,6 @@ struct return_type_2, A, B> { }; - -} // namespace lambda -} // namespace boost - - -// Forward declarations are incompatible with the libstdc++ debug mode. -#if BOOST_WORKAROUND(__GNUC__, >= 3) && defined(_GLIBCXX_DEBUG) -#include -#include -#include -#include -#else - -// The GCC 2.95.x uses a non-conformant deque -#if BOOST_WORKAROUND(__GNUC__, == 2) && __GNUC_MINOR__ <= 96 -#include -#else - -namespace std { - template class deque; -} - -#endif - -namespace std { - template class basic_string; - template class vector; - template class map; - template class multimap; -} - -#endif - - - -namespace boost { -namespace lambda { - template struct plain_return_type_2, std::map, B> { typedef T& type; From c14095472ea2a26c2103131027acae6c4adaa6f3 Mon Sep 17 00:00:00 2001 From: Steven Watanabe Date: Fri, 5 Jun 2009 02:43:54 +0000 Subject: [PATCH 26/42] Don't propagate constness from pointer to pointee. Fixes #1572 [SVN r53651] --- .../detail/operator_return_type_traits.hpp | 28 ++----------------- test/operator_tests_simple.cpp | 12 ++++++++ 2 files changed, 15 insertions(+), 25 deletions(-) diff --git a/include/boost/lambda/detail/operator_return_type_traits.hpp b/include/boost/lambda/detail/operator_return_type_traits.hpp index d13af91..b2d3d3a 100644 --- a/include/boost/lambda/detail/operator_return_type_traits.hpp +++ b/include/boost/lambda/detail/operator_return_type_traits.hpp @@ -225,37 +225,15 @@ template <> struct contentsof_type { template struct contentsof_type { - typedef typename contentsof_type::type type1; - // return a reference to the underlying const type - // 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 boost::remove_reference::type no_reference; - typedef typename detail::IF< - is_reference::value, - const no_reference &, - const no_reference - >::RET type; + typedef typename contentsof_type::type 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 no_reference &, - volatile no_reference - >::RET type; + typedef typename contentsof_type::type 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 no_reference &, - const volatile no_reference - >::RET type; + typedef typename contentsof_type::type type; }; // standard iterator traits should take care of the pointer types diff --git a/test/operator_tests_simple.cpp b/test/operator_tests_simple.cpp index 78eae51..aa3069d 100644 --- a/test/operator_tests_simple.cpp +++ b/test/operator_tests_simple.cpp @@ -19,6 +19,8 @@ #include "boost/lambda/detail/suppress_unused.hpp" +#include + #include #include #include @@ -323,8 +325,18 @@ void address_of_and_dereference() { (*_1 = 7)(it); BOOST_CHECK(vi[0] == 7); + const std::vector::iterator cit(it); + (*_1 = 8)(cit); + BOOST_CHECK(vi[0] == 8); // TODO: Add tests for more complex iterator types + + boost::shared_ptr ptr(new int(0)); + (*_1 = 7)(ptr); + BOOST_CHECK(*ptr == 7); + const boost::shared_ptr cptr(ptr); + (*_1 = 8)(cptr); + BOOST_CHECK(*ptr == 8); } From 3d4a3e7050852b30e853f013814a30014a0fa674 Mon Sep 17 00:00:00 2001 From: "Troy D. Straszheim" Date: Sun, 26 Jul 2009 00:49:56 +0000 Subject: [PATCH 27/42] Copyrights on CMakeLists.txt to keep them from clogging up the inspect reports. This is essentially the same commit as r55095 on the release branch. [SVN r55159] --- CMakeLists.txt | 6 ++++++ test/CMakeLists.txt | 6 ++++++ 2 files changed, 12 insertions(+) diff --git a/CMakeLists.txt b/CMakeLists.txt index c822430..e5c6f1a 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -1,3 +1,9 @@ +# +# Copyright Troy D. Straszheim +# +# Distributed under the Boost Software License, Version 1.0. +# See http://www.boost.org/LICENSE_1_0.txt +# #---------------------------------------------------------------------------- # This file was automatically generated from the original CMakeLists.txt file # Add a variable to hold the headers for the library diff --git a/test/CMakeLists.txt b/test/CMakeLists.txt index ae75a2b..4f9a74f 100644 --- a/test/CMakeLists.txt +++ b/test/CMakeLists.txt @@ -1,3 +1,9 @@ +# +# Copyright Troy D. Straszheim +# +# Distributed under the Boost Software License, Version 1.0. +# See http://www.boost.org/LICENSE_1_0.txt +# boost_additional_test_dependencies(lambda BOOST_DEPENDS test any) boost_test_run(algorithm_test DEPENDS boost_test_exec_monitor) From c183b699bc8f2bc58578f4701facf9d9fb229a85 Mon Sep 17 00:00:00 2001 From: "Troy D. Straszheim" Date: Sat, 17 Oct 2009 02:07:38 +0000 Subject: [PATCH 28/42] rm cmake from trunk. I'm not entirely sure this is necessary to satisfy the inspect script, but I'm not taking any chances, and it is easy to put back [SVN r56942] --- CMakeLists.txt | 27 --------------------------- module.cmake | 1 - test/CMakeLists.txt | 24 ------------------------ 3 files changed, 52 deletions(-) delete mode 100644 CMakeLists.txt delete mode 100644 module.cmake delete mode 100644 test/CMakeLists.txt diff --git a/CMakeLists.txt b/CMakeLists.txt deleted file mode 100644 index e5c6f1a..0000000 --- a/CMakeLists.txt +++ /dev/null @@ -1,27 +0,0 @@ -# -# Copyright Troy D. Straszheim -# -# Distributed under the Boost Software License, Version 1.0. -# See http://www.boost.org/LICENSE_1_0.txt -# -#---------------------------------------------------------------------------- -# This file was automatically generated from the original CMakeLists.txt file -# Add a variable to hold the headers for the library -set (lib_headers - lambda -) - -# Add a library target to the build system -boost_library_project( - lambda - # SRCDIRS - TESTDIRS test - HEADERS ${lib_headers} - # DOCDIRS - # DESCRIPTION - MODULARIZED - # AUTHORS - # MAINTAINERS -) - - diff --git a/module.cmake b/module.cmake deleted file mode 100644 index 9f7a073..0000000 --- a/module.cmake +++ /dev/null @@ -1 +0,0 @@ -boost_module(lambda DEPENDS tuple) \ No newline at end of file diff --git a/test/CMakeLists.txt b/test/CMakeLists.txt deleted file mode 100644 index 4f9a74f..0000000 --- a/test/CMakeLists.txt +++ /dev/null @@ -1,24 +0,0 @@ -# -# Copyright Troy D. Straszheim -# -# Distributed under the Boost Software License, Version 1.0. -# See http://www.boost.org/LICENSE_1_0.txt -# -boost_additional_test_dependencies(lambda BOOST_DEPENDS test any) - -boost_test_run(algorithm_test DEPENDS boost_test_exec_monitor) -boost_test_run(bind_tests_simple DEPENDS boost_test_exec_monitor) -boost_test_run(bind_tests_advanced DEPENDS boost_test_exec_monitor) -boost_test_run(bind_tests_simple_f_refs DEPENDS boost_test_exec_monitor) -boost_test_run(bll_and_function DEPENDS boost_test_exec_monitor) -boost_test_run(lambda_cast_test - cast_test.cpp DEPENDS boost_test_exec_monitor) -boost_test_run(constructor_tests DEPENDS boost_test_exec_monitor) -boost_test_run(control_structures DEPENDS boost_test_exec_monitor) -boost_test_run(exception_test DEPENDS boost_test_exec_monitor) -boost_test_run(extending_rt_traits DEPENDS boost_test_exec_monitor) -boost_test_run(is_instance_of_test DEPENDS boost_test_exec_monitor) -boost_test_run(member_pointer_test DEPENDS boost_test_exec_monitor) -boost_test_run(operator_tests_simple DEPENDS boost_test_exec_monitor) -boost_test_run(phoenix_control_structures DEPENDS boost_test_exec_monitor) -boost_test_run(switch_construct DEPENDS boost_test_exec_monitor) From 77495bb7e16ce9cb250de4ae100dd10572adc54d Mon Sep 17 00:00:00 2001 From: Steven Watanabe Date: Sun, 8 Nov 2009 04:11:21 +0000 Subject: [PATCH 29/42] Deal with warnings with /Za. Fixes #3485 [SVN r57479] --- include/boost/lambda/detail/lambda_functor_base.hpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/include/boost/lambda/detail/lambda_functor_base.hpp b/include/boost/lambda/detail/lambda_functor_base.hpp index e5bb02a..17e67ed 100644 --- a/include/boost/lambda/detail/lambda_functor_base.hpp +++ b/include/boost/lambda/detail/lambda_functor_base.hpp @@ -40,7 +40,7 @@ public: explicit identity(par_t t) : elem(t) {} template - struct sig { typedef element_t type; }; + struct sig { typedef typename boost::remove_const::type type; }; template RET call(CALL_FORMAL_ARGS) const { CALL_USE_ARGS; return elem; } From 15d4e6ab793e394bd7267611be67a772990d8b4a Mon Sep 17 00:00:00 2001 From: Steven Watanabe Date: Sun, 9 May 2010 20:07:07 +0000 Subject: [PATCH 30/42] Make sure that all top level headers in Lambda include their dependencies. Fixes #4203 [SVN r61881] --- include/boost/lambda/casts.hpp | 4 + include/boost/lambda/closures.hpp | 2 +- include/boost/lambda/construct.hpp | 3 + include/boost/lambda/control_structures.hpp | 3 +- .../lambda/detail/control_structures_impl.hpp | 550 ------------------ .../lambda/detail/lambda_functor_base.hpp | 6 + include/boost/lambda/detail/lambda_traits.hpp | 1 + include/boost/lambda/exceptions.hpp | 1 + 8 files changed, 18 insertions(+), 552 deletions(-) delete mode 100644 include/boost/lambda/detail/control_structures_impl.hpp diff --git a/include/boost/lambda/casts.hpp b/include/boost/lambda/casts.hpp index 29437a8..8b3d3a7 100644 --- a/include/boost/lambda/casts.hpp +++ b/include/boost/lambda/casts.hpp @@ -15,12 +15,16 @@ #define BOOST_LAMBDA_CASTS_HPP #include "boost/lambda/detail/suppress_unused.hpp" +#include "boost/lambda/core.hpp" #include namespace boost { namespace lambda { +template +struct return_type_N; + template class cast_action; template class static_cast_action; diff --git a/include/boost/lambda/closures.hpp b/include/boost/lambda/closures.hpp index a6a2b07..f09c8a5 100644 --- a/include/boost/lambda/closures.hpp +++ b/include/boost/lambda/closures.hpp @@ -251,7 +251,7 @@ private: closure& operator=(closure const&); // no assign template - friend struct closure_member; + friend class closure_member; template friend class closure_frame; diff --git a/include/boost/lambda/construct.hpp b/include/boost/lambda/construct.hpp index f6e5e05..06da171 100644 --- a/include/boost/lambda/construct.hpp +++ b/include/boost/lambda/construct.hpp @@ -14,6 +14,9 @@ #if !defined(BOOST_LAMBDA_CONSTRUCT_HPP) #define BOOST_LAMBDA_CONSTRUCT_HPP +#include "boost/type_traits/remove_cv.hpp" +#include "boost/type_traits/is_pointer.hpp" + namespace boost { namespace lambda { diff --git a/include/boost/lambda/control_structures.hpp b/include/boost/lambda/control_structures.hpp index 4164104..74cb97c 100644 --- a/include/boost/lambda/control_structures.hpp +++ b/include/boost/lambda/control_structures.hpp @@ -17,6 +17,7 @@ #include "boost/lambda/detail/operator_actions.hpp" #include "boost/lambda/detail/operator_return_type_traits.hpp" -#include "boost/lambda/detail/control_structures_impl.hpp" +#include "boost/lambda/if.hpp" +#include "boost/lambda/loops.hpp" #endif diff --git a/include/boost/lambda/detail/control_structures_impl.hpp b/include/boost/lambda/detail/control_structures_impl.hpp deleted file mode 100644 index 56f80ac..0000000 --- a/include/boost/lambda/detail/control_structures_impl.hpp +++ /dev/null @@ -1,550 +0,0 @@ -// Boost Lambda Library -- control_structures_impl.hpp --------------------- - -// Copyright (C) 1999, 2000 Jaakko Jarvi (jaakko.jarvi@cs.utu.fi) -// Copyright (C) 2000 Gary Powell (powellg@amazon.com) -// -// 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 - -// -------------------------------------------------------------------------- - -#if !defined(BOOST_LAMBDA_CONTROL_CONSTRUCTS_HPP) -#define BOOST_LAMBDA_CONTROL_CONSTRUCTS_HPP - -namespace boost { -namespace lambda { - -// -- void return control actions ---------------------- - -class forloop_action {}; -class forloop_no_body_action {}; -class ifthen_action {}; -class ifthenelse_action {}; -class whileloop_action {}; -class whileloop_no_body_action {}; -class dowhileloop_action {}; -class dowhileloop_no_body_action {}; -// -- nonvoid return control actions ---------------------- - -class ifthenelsereturn_action {}; - -// For loop -template -inline const -lambda_functor< - lambda_functor_base< - forloop_action, - tuple, lambda_functor, - lambda_functor, lambda_functor > - > -> -for_loop(const lambda_functor& a1, const lambda_functor& a2, - const lambda_functor& a3, const lambda_functor& a4) { - return - lambda_functor_base< - forloop_action, - tuple, lambda_functor, - lambda_functor, lambda_functor > - > - ( tuple, lambda_functor, - lambda_functor, lambda_functor >(a1, a2, a3, a4) - ); -} - -// No body case. -template -inline const -lambda_functor< - lambda_functor_base< - forloop_no_body_action, - tuple, lambda_functor, lambda_functor > - > -> -for_loop(const lambda_functor& a1, const lambda_functor& a2, - const lambda_functor& a3) { - return - lambda_functor_base< - forloop_no_body_action, - tuple, lambda_functor, - lambda_functor > - > - ( tuple, lambda_functor, - lambda_functor >(a1, a2, a3) ); -} - -// While loop -template -inline const -lambda_functor< - lambda_functor_base< - whileloop_action, - tuple, lambda_functor > - > -> -while_loop(const lambda_functor& a1, const lambda_functor& a2) { - return - lambda_functor_base< - whileloop_action, - tuple, lambda_functor > - > - ( tuple, lambda_functor >(a1, a2)); -} - -// No body case. -template -inline const -lambda_functor< - lambda_functor_base< - whileloop_no_body_action, - tuple > - > -> -while_loop(const lambda_functor& a1) { - return - lambda_functor_base< - whileloop_no_body_action, - tuple > - > - ( tuple >(a1) ); -} - - -// Do While loop -template -inline const -lambda_functor< - lambda_functor_base< - dowhileloop_action, - tuple, lambda_functor > - > -> -do_while_loop(const lambda_functor& a1, const lambda_functor& a2) { - return - lambda_functor_base< - dowhileloop_action, - tuple, lambda_functor > - > - ( tuple, lambda_functor >(a1, a2)); -} - -// No body case. -template -inline const -lambda_functor< - lambda_functor_base< - dowhileloop_no_body_action, - tuple > - > -> -do_while_loop(const lambda_functor& a1) { - return - lambda_functor_base< - dowhileloop_no_body_action, - tuple > - > - ( tuple >(a1)); -} - - -// If Then -template -inline const -lambda_functor< - lambda_functor_base< - ifthen_action, - tuple, lambda_functor > - > -> -if_then(const lambda_functor& a1, const lambda_functor& a2) { - return - lambda_functor_base< - ifthen_action, - tuple, lambda_functor > - > - ( tuple, lambda_functor >(a1, a2) ); -} - -// If then else - -template -inline const -lambda_functor< - lambda_functor_base< - ifthenelse_action, - tuple, lambda_functor, lambda_functor > - > -> -if_then_else(const lambda_functor& a1, const lambda_functor& a2, - const lambda_functor& a3) { - return - lambda_functor_base< - ifthenelse_action, - tuple, lambda_functor, lambda_functor > - > - (tuple, lambda_functor, lambda_functor > - (a1, a2, a3) ); -} - -// Our version of operator?:() - -template -inline const - lambda_functor< - lambda_functor_base< - other_action, - tuple, - typename const_copy_argument::type, - typename const_copy_argument::type> - > -> -if_then_else_return(const lambda_functor& a1, - const Arg2 & a2, - const Arg3 & a3) { - return - lambda_functor_base< - other_action, - tuple, - typename const_copy_argument::type, - typename const_copy_argument::type> - > ( tuple, - typename const_copy_argument::type, - typename const_copy_argument::type> (a1, a2, a3) ); -} - -namespace detail { - -// return type specialization for conditional expression begins ----------- -// start reading below and move upwards - -// PHASE 6:1 -// check if A is conbertible to B and B to A -template -struct return_type_2_ifthenelsereturn; - -// if A can be converted to B and vice versa -> ambiguous -template -struct return_type_2_ifthenelsereturn { - typedef - detail::return_type_deduction_failure type; - // ambiguous type in conditional expression -}; -// if A can be converted to B and vice versa and are of same type -template -struct return_type_2_ifthenelsereturn { - typedef A type; -}; - - -// A can be converted to B -template -struct return_type_2_ifthenelsereturn { - typedef B type; -}; - -// B can be converted to A -template -struct return_type_2_ifthenelsereturn { - typedef A type; -}; - -// neither can be converted. Then we drop the potential references, and -// try again -template -struct return_type_2_ifthenelsereturn<1, false, false, false, A, B> { - // it is safe to add const, since the result will be an rvalue and thus - // const anyway. The const are needed eg. if the types - // are 'const int*' and 'void *'. The remaining type should be 'const void*' - typedef const typename boost::remove_reference::type plainA; - typedef const typename boost::remove_reference::type plainB; - // TODO: Add support for volatile ? - - typedef typename - return_type_2_ifthenelsereturn< - 2, - boost::is_convertible::value, - boost::is_convertible::value, - boost::is_same::value, - plainA, - plainB>::type type; -}; - -// PHASE 6:2 -template -struct return_type_2_ifthenelsereturn<2, false, false, false, A, B> { - typedef - detail::return_type_deduction_failure type; - // types_do_not_match_in_conditional_expression -}; - - - -// PHASE 5: now we know that types are not arithmetic. -template -struct non_numeric_types { - typedef typename - return_type_2_ifthenelsereturn< - 1, // phase 1 - is_convertible::value, - is_convertible::value, - is_same::value, - A, - B>::type type; -}; - -// PHASE 4 : -// the base case covers arithmetic types with differing promote codes -// use the type deduction of arithmetic_actions -template -struct arithmetic_or_not { - typedef typename - return_type_2, A, B>::type type; - // plus_action is just a random pick, has to be a concrete instance -}; - -// this case covers the case of artihmetic types with the same promote codes. -// non numeric deduction is used since e.g. integral promotion is not -// performed with operator ?: -template -struct arithmetic_or_not { - typedef typename non_numeric_types::type type; -}; - -// if either A or B has promote code -1 it is not an arithmetic type -template -struct arithmetic_or_not <-1, -1, A, B> { - typedef typename non_numeric_types::type type; -}; -template -struct arithmetic_or_not <-1, CodeB, A, B> { - typedef typename non_numeric_types::type type; -}; -template -struct arithmetic_or_not { - typedef typename non_numeric_types::type type; -}; - - - - -// PHASE 3 : Are the types same? -// No, check if they are arithmetic or not -template -struct same_or_not { - typedef typename detail::remove_reference_and_cv::type plainA; - typedef typename detail::remove_reference_and_cv::type plainB; - - typedef typename - arithmetic_or_not< - detail::promote_code::value, - detail::promote_code::value, - A, - B>::type type; -}; -// Yes, clear. -template struct same_or_not { - typedef A type; -}; - -} // detail - -// PHASE 2 : Perform first the potential array_to_pointer conversion -template -struct return_type_2, A, B> { - - typedef typename detail::array_to_pointer::type A1; - typedef typename detail::array_to_pointer::type B1; - - typedef typename - boost::add_const::type>::type type; -}; - -// PHASE 1 : Deduction is based on the second and third operand - - -// return type specialization for conditional expression ends ----------- - - - - -// Control loop lambda_functor_base specializations. - -// Specialization for for_loop. -template -class -lambda_functor_base { -public: - Args args; - template struct sig { typedef void type; }; -public: - explicit lambda_functor_base(const Args& a) : args(a) {} - - template - RET call(CALL_FORMAL_ARGS) const { - for(detail::select(boost::tuples::get<0>(args), CALL_ACTUAL_ARGS); - detail::select(boost::tuples::get<1>(args), CALL_ACTUAL_ARGS); - detail::select(boost::tuples::get<2>(args), CALL_ACTUAL_ARGS)) - - detail::select(boost::tuples::get<3>(args), CALL_ACTUAL_ARGS); - } -}; - -// No body case -template -class -lambda_functor_base { -public: - Args args; - template struct sig { typedef void type; }; -public: - explicit lambda_functor_base(const Args& a) : args(a) {} - - template - RET call(CALL_FORMAL_ARGS) const { - for(detail::select(boost::tuples::get<0>(args), CALL_ACTUAL_ARGS); - detail::select(boost::tuples::get<1>(args), CALL_ACTUAL_ARGS); - detail::select(boost::tuples::get<2>(args), CALL_ACTUAL_ARGS)) {} - } -}; - - -// Specialization for while_loop. -template -class -lambda_functor_base { -public: - Args args; - template struct sig { typedef void type; }; -public: - explicit lambda_functor_base(const Args& a) : args(a) {} - - template - RET call(CALL_FORMAL_ARGS) const { - while(detail::select(boost::tuples::get<0>(args), CALL_ACTUAL_ARGS)) - - detail::select(boost::tuples::get<1>(args), CALL_ACTUAL_ARGS); - } -}; - -// No body case -template -class -lambda_functor_base { -public: - Args args; - template struct sig { typedef void type; }; -public: - explicit lambda_functor_base(const Args& a) : args(a) {} - - template - RET call(CALL_FORMAL_ARGS) const { - while(detail::select(boost::tuples::get<0>(args), CALL_ACTUAL_ARGS)) {} - } -}; - -// Specialization for do_while_loop. -// Note that the first argument is the condition. -template -class -lambda_functor_base { -public: - Args args; - template struct sig { typedef void type; }; -public: - explicit lambda_functor_base(const Args& a) : args(a) {} - - template - RET call(CALL_FORMAL_ARGS) const { - do { - detail::select(boost::tuples::get<1>(args), CALL_ACTUAL_ARGS); - } while (detail::select(boost::tuples::get<0>(args), CALL_ACTUAL_ARGS) ); - } -}; - -// No body case -template -class -lambda_functor_base { -public: - Args args; - template struct sig { typedef void type; }; -public: - explicit lambda_functor_base(const Args& a) : args(a) {} - - template - RET call(CALL_FORMAL_ARGS) const { - do {} while (detail::select(boost::tuples::get<0>(args), CALL_ACTUAL_ARGS) ); - } -}; - - -// Specialization for if_then. -template -class -lambda_functor_base { -public: - Args args; - template struct sig { typedef void type; }; -public: - explicit lambda_functor_base(const Args& a) : args(a) {} - - template - RET call(CALL_FORMAL_ARGS) const { - if (detail::select(boost::tuples::get<0>(args), CALL_ACTUAL_ARGS)) detail::select(boost::tuples::get<1>(args), CALL_ACTUAL_ARGS); - } -}; - -// Specialization for if_then_else. -template -class -lambda_functor_base { -public: - Args args; - template struct sig { typedef void type; }; -public: - explicit lambda_functor_base(const Args& a) : args(a) {} - - template - RET call(CALL_FORMAL_ARGS) const { - if (detail::select(boost::tuples::get<0>(args), CALL_ACTUAL_ARGS)) - detail::select(boost::tuples::get<1>(args), CALL_ACTUAL_ARGS); - else - detail::select(boost::tuples::get<2>(args), CALL_ACTUAL_ARGS); - } -}; - -// Specialization of lambda_functor_base for if_then_else_return. -template -class -lambda_functor_base, Args> { -public: - Args args; - - template struct sig { - private: - typedef typename detail::nth_return_type_sig<1, Args, SigArgs>::type ret1; - typedef typename detail::nth_return_type_sig<2, Args, SigArgs>::type ret2; - public: - typedef typename return_type_2< - other_action, ret1, ret2 - >::type type; - }; - -public: - explicit lambda_functor_base(const Args& a) : args(a) {} - - template - RET call(CALL_FORMAL_ARGS) const { - return (detail::select(boost::tuples::get<0>(args), CALL_ACTUAL_ARGS)) ? - detail::select(boost::tuples::get<1>(args), CALL_ACTUAL_ARGS) - : - detail::select(boost::tuples::get<2>(args), CALL_ACTUAL_ARGS); - } -}; - -} // lambda -} // boost - -#endif // BOOST_LAMBDA_CONTROL_CONSTRUCTS_HPP diff --git a/include/boost/lambda/detail/lambda_functor_base.hpp b/include/boost/lambda/detail/lambda_functor_base.hpp index 17e67ed..5bd3c90 100644 --- a/include/boost/lambda/detail/lambda_functor_base.hpp +++ b/include/boost/lambda/detail/lambda_functor_base.hpp @@ -13,6 +13,12 @@ #ifndef BOOST_LAMBDA_LAMBDA_FUNCTOR_BASE_HPP #define BOOST_LAMBDA_LAMBDA_FUNCTOR_BASE_HPP +#include "boost/type_traits/add_reference.hpp" +#include "boost/type_traits/add_const.hpp" +#include "boost/type_traits/remove_const.hpp" +#include "boost/lambda/detail/lambda_fwd.hpp" +#include "boost/lambda/detail/lambda_traits.hpp" + namespace boost { namespace lambda { diff --git a/include/boost/lambda/detail/lambda_traits.hpp b/include/boost/lambda/detail/lambda_traits.hpp index 0e683c2..f35fa09 100644 --- a/include/boost/lambda/detail/lambda_traits.hpp +++ b/include/boost/lambda/detail/lambda_traits.hpp @@ -16,6 +16,7 @@ #include "boost/type_traits/cv_traits.hpp" #include "boost/type_traits/function_traits.hpp" #include "boost/type_traits/object_traits.hpp" +#include "boost/tuple/tuple.hpp" namespace boost { namespace lambda { diff --git a/include/boost/lambda/exceptions.hpp b/include/boost/lambda/exceptions.hpp index addb275..4f7e895 100644 --- a/include/boost/lambda/exceptions.hpp +++ b/include/boost/lambda/exceptions.hpp @@ -14,6 +14,7 @@ #if !defined(BOOST_LAMBDA_EXCEPTIONS_HPP) #define BOOST_LAMBDA_EXCEPTIONS_HPP +#include "boost/lambda/core.hpp" #include "boost/lambda/detail/control_constructs_common.hpp" namespace boost { From 269ac93b1b2e7057752abe4eee8f4f83d6e3d049 Mon Sep 17 00:00:00 2001 From: Jeremiah Willcock Date: Wed, 9 Jun 2010 00:16:43 +0000 Subject: [PATCH 31/42] Added Jamfile.v2 from Daniel Walker; refs #864 [SVN r62617] --- test/Jamfile.v2 | 45 +++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 45 insertions(+) create mode 100644 test/Jamfile.v2 diff --git a/test/Jamfile.v2 b/test/Jamfile.v2 new file mode 100644 index 0000000..d3e1640 --- /dev/null +++ b/test/Jamfile.v2 @@ -0,0 +1,45 @@ +# Lambda library + +# Copyright (C) 2001-2007 Jaakko Järvi, Daniel Walker + +# Use, modification and distribution is subject to 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 http://www.boost.org/ + +# bring in rules for testing +import testing ; + +test-suite lambda + : + [ run algorithm_test.cpp ] + + [ run bind_tests_simple.cpp ] + + [ run bind_tests_advanced.cpp ] + + [ run bind_tests_simple_f_refs.cpp ] + + [ run bll_and_function.cpp ] + + [ run cast_test.cpp ] + + [ run constructor_tests.cpp ] + + [ run control_structures.cpp ] + + [ run exception_test.cpp ] + + [ run extending_rt_traits.cpp ] + + [ run is_instance_of_test.cpp ] + + [ run member_pointer_test.cpp ] + + [ run operator_tests_simple.cpp ] + + [ run phoenix_control_structures.cpp ] + + [ run switch_construct.cpp ] + ; From c479b3b7b78d7c6722a5256e9e9bb126064abb2b Mon Sep 17 00:00:00 2001 From: Jeremiah Willcock Date: Wed, 9 Jun 2010 00:31:02 +0000 Subject: [PATCH 32/42] Fixed warning [SVN r62619] --- test/cast_test.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/test/cast_test.cpp b/test/cast_test.cpp index 941b42f..eba4300 100644 --- a/test/cast_test.cpp +++ b/test/cast_test.cpp @@ -29,7 +29,7 @@ class base { public: virtual std::string class_name() const { return "const base"; } virtual std::string class_name() { return "base"; } - + virtual ~base() {} }; class derived : public base { From c516504670eb54a769461dc192baf24aab8451f9 Mon Sep 17 00:00:00 2001 From: Jeremiah Willcock Date: Wed, 9 Jun 2010 00:33:25 +0000 Subject: [PATCH 33/42] Changed compound assignment (and actually all binary operators) to copy their RHS arguments like the documentation said; added a test for this; fixes #4043 [SVN r62620] --- include/boost/lambda/detail/operators.hpp | 6 +++--- test/operator_tests_simple.cpp | 16 ++++++++++++++++ 2 files changed, 19 insertions(+), 3 deletions(-) diff --git a/include/boost/lambda/detail/operators.hpp b/include/boost/lambda/detail/operators.hpp index 29eb106..149e1ee 100644 --- a/include/boost/lambda/detail/operators.hpp +++ b/include/boost/lambda/detail/operators.hpp @@ -37,16 +37,16 @@ inline const \ lambda_functor< \ lambda_functor_base< \ ACTION, \ - tuple, typename CONVERSION ::type> \ + tuple, typename const_copy_argument ::type> \ > \ > \ OPER_NAME (const lambda_functor& a, CONSTB& b) { \ return \ lambda_functor_base< \ ACTION, \ - tuple, typename CONVERSION ::type> \ + tuple, typename const_copy_argument ::type>\ > \ - (tuple, typename CONVERSION ::type>(a, b)); \ + (tuple, typename const_copy_argument ::type>(a, b)); \ } diff --git a/test/operator_tests_simple.cpp b/test/operator_tests_simple.cpp index aa3069d..34711fb 100644 --- a/test/operator_tests_simple.cpp +++ b/test/operator_tests_simple.cpp @@ -235,6 +235,22 @@ void compound_operators() { (_1 %= 2)(i); BOOST_CHECK(i == 1); + // lambda expression as a left operand with rvalue on RHS + (_1 += (0 + 1))(i); + BOOST_CHECK(i == 2); + + (_1 -= (0 + 1))(i); + BOOST_CHECK(i == 1); + + (_1 *= (0 + 10))(i); + BOOST_CHECK(i == 10); + + (_1 /= (0 + 2))(i); + BOOST_CHECK(i == 5); + + (_1 %= (0 + 2))(i); + BOOST_CHECK(i == 1); + // shifts unsigned int ui = 2; (_1 <<= 1)(ui); From fcfcc42baf4b7c65a46c785e077bf374a680038f Mon Sep 17 00:00:00 2001 From: Steven Watanabe Date: Wed, 9 Jun 2010 01:39:48 +0000 Subject: [PATCH 34/42] Enable using result_of with Boost.Lambda. Fixes #426. Fixes #864 [SVN r62627] --- .../boost/lambda/detail/function_adaptors.hpp | 158 ++++++++- .../lambda/detail/lambda_functor_base.hpp | 2 +- .../boost/lambda/detail/lambda_functors.hpp | 19 ++ .../lambda/detail/return_type_traits.hpp | 2 - test/Jamfile | 1 + test/bind_tests_advanced.cpp | 67 +++- test/result_of_tests.cpp | 314 ++++++++++++++++++ 7 files changed, 540 insertions(+), 23 deletions(-) create mode 100644 test/result_of_tests.cpp diff --git a/include/boost/lambda/detail/function_adaptors.hpp b/include/boost/lambda/detail/function_adaptors.hpp index c30cbc6..cfe3b07 100644 --- a/include/boost/lambda/detail/function_adaptors.hpp +++ b/include/boost/lambda/detail/function_adaptors.hpp @@ -12,25 +12,167 @@ #ifndef BOOST_LAMBDA_FUNCTION_ADAPTORS_HPP #define BOOST_LAMBDA_FUNCTION_ADAPTORS_HPP +#include "boost/mpl/has_xxx.hpp" +#include "boost/tuple/tuple.hpp" #include "boost/type_traits/same_traits.hpp" +#include "boost/type_traits/remove_reference.hpp" +#include "boost/utility/result_of.hpp" namespace boost { namespace lambda { +namespace detail { + +BOOST_MPL_HAS_XXX_TEMPLATE_NAMED_DEF(has_template_sig, sig, 1, true) + +template +struct remove_references_from_elements { + typedef typename boost::tuples::cons< + typename boost::remove_reference::type, + typename remove_references_from_elements::type + > type; +}; + +template<> +struct remove_references_from_elements { + typedef boost::tuples::null_type type; +}; + +} + template struct function_adaptor { + typedef typename detail::remove_reference_and_cv::type plainF; + +#if !defined(BOOST_NO_RESULT_OF) + // Support functors that use the boost::result_of return type convention. + template + struct result_converter; + template + struct result_converter + : plainF::template sig< + typename detail::remove_references_from_elements::type + > + {}; + template + struct result_converter + : result_of + {}; + template + struct result_converter + : result_of::type) + > + {}; + template + struct result_converter + : result_of::type, + typename tuples::element<2, Tuple>::type) + > + {}; + template + struct result_converter + : result_of::type, + typename tuples::element<2, Tuple>::type, + typename tuples::element<3, Tuple>::type) + > + {}; + template + struct result_converter + : result_of::type, + typename tuples::element<2, Tuple>::type, + typename tuples::element<3, Tuple>::type, + typename tuples::element<4, Tuple>::type) + > + {}; + template + struct result_converter + : result_of::type, + typename tuples::element<2, Tuple>::type, + typename tuples::element<3, Tuple>::type, + typename tuples::element<4, Tuple>::type, + typename tuples::element<5, Tuple>::type) + > + {}; + template + struct result_converter + : result_of::type, + typename tuples::element<2, Tuple>::type, + typename tuples::element<3, Tuple>::type, + typename tuples::element<4, Tuple>::type, + typename tuples::element<5, Tuple>::type, + typename tuples::element<6, Tuple>::type) + > + {}; + template + struct result_converter + : result_of::type, + typename tuples::element<2, Tuple>::type, + typename tuples::element<3, Tuple>::type, + typename tuples::element<4, Tuple>::type, + typename tuples::element<5, Tuple>::type, + typename tuples::element<6, Tuple>::type, + typename tuples::element<7, Tuple>::type) + > + {}; + template + struct result_converter + : result_of::type, + typename tuples::element<2, Tuple>::type, + typename tuples::element<3, Tuple>::type, + typename tuples::element<4, Tuple>::type, + typename tuples::element<5, Tuple>::type, + typename tuples::element<6, Tuple>::type, + typename tuples::element<7, Tuple>::type, + typename tuples::element<8, Tuple>::type) + > + {}; + template + struct result_converter + : result_of::type, + typename tuples::element<2, Tuple>::type, + typename tuples::element<3, Tuple>::type, + typename tuples::element<4, Tuple>::type, + typename tuples::element<5, Tuple>::type, + typename tuples::element<6, Tuple>::type, + typename tuples::element<7, Tuple>::type, + typename tuples::element<8, Tuple>::type, + typename tuples::element<9, Tuple>::type) + > + {}; + // we do not know the return type off-hand, we must ask it from Func - template class sig { - typedef typename Args::head_type F; + // To sig we pass a cons list, where the head is the function object type + // itself (potentially cv-qualified) + // and the tail contains the types of the actual arguments to be passed + // to the function object. The arguments can be cv qualified + // as well. + template + struct sig + : result_converter< + Args + , tuples::length::value + , detail::has_template_sig::value + > + {}; +#else // BOOST_NO_RESULT_OF + + template class sig { typedef typename detail::remove_reference_and_cv::type plainF; public: - // To sig we pass a cons list, where the head is the function object type - // itself (potentially cv-qualified) - // and the tail contains the types of the actual arguments to be passed - // to the function object. The arguments can be cv qualified - // as well. - typedef typename plainF::template sig::type type; + typedef typename plainF::template sig< + typename detail::remove_references_from_elements::type + >::type type; }; +#endif template static RET apply(A1& a1) { diff --git a/include/boost/lambda/detail/lambda_functor_base.hpp b/include/boost/lambda/detail/lambda_functor_base.hpp index 5bd3c90..b084acd 100644 --- a/include/boost/lambda/detail/lambda_functor_base.hpp +++ b/include/boost/lambda/detail/lambda_functor_base.hpp @@ -383,7 +383,7 @@ public: \ \ template struct sig { \ typedef typename \ - detail::deduce_non_ref_argument_types::type rets_t; \ + detail::deduce_argument_types::type rets_t; \ public: \ typedef typename \ return_type_N_prot::type type; \ diff --git a/include/boost/lambda/detail/lambda_functors.hpp b/include/boost/lambda/detail/lambda_functors.hpp index 5187c7d..9b1b082 100644 --- a/include/boost/lambda/detail/lambda_functors.hpp +++ b/include/boost/lambda/detail/lambda_functors.hpp @@ -161,6 +161,25 @@ public: inherited::template sig::type nullary_return_type; + // Support for boost::result_of. + template struct result; + template + struct result { + typedef nullary_return_type type; + }; + template + struct result { + typedef typename sig >::type type; + }; + template + struct result { + typedef typename sig >::type type; + }; + template + struct result { + typedef typename sig >::type type; + }; + nullary_return_type operator()() const { return inherited::template call diff --git a/include/boost/lambda/detail/return_type_traits.hpp b/include/boost/lambda/detail/return_type_traits.hpp index d609e52..bf2394e 100644 --- a/include/boost/lambda/detail/return_type_traits.hpp +++ b/include/boost/lambda/detail/return_type_traits.hpp @@ -216,8 +216,6 @@ typedef typename // currently there are no protectable actions with > 2 args - // Note, that if there will be, lambda_functor_base will have to be - // changed to not get rid of references in Args elements template struct return_type_N_prot { typedef typename return_type_N::type type; diff --git a/test/Jamfile b/test/Jamfile index 4080eb3..7e1a5a7 100644 --- a/test/Jamfile +++ b/test/Jamfile @@ -30,5 +30,6 @@ test-suite lambda [ run operator_tests_simple.cpp ] [ run phoenix_control_structures.cpp ] [ run switch_construct.cpp ] + [ run result_of_tests.cpp ] [ run ret_test.cpp ] ; diff --git a/test/bind_tests_advanced.cpp b/test/bind_tests_advanced.cpp index a891f91..d696e49 100644 --- a/test/bind_tests_advanced.cpp +++ b/test/bind_tests_advanced.cpp @@ -2,6 +2,7 @@ // // Copyright (C) 2000-2003 Jaakko Jarvi (jaakko.jarvi@cs.utu.fi) // Copyright (C) 2000-2003 Gary Powell (powellg@amazon.com) +// Copyright (C) 2010 Steven Watanabe // // Distributed under the Boost Software License, Version 1.0. (See // accompanying file LICENSE_1_0.txt or copy at @@ -19,6 +20,9 @@ #include "boost/any.hpp" +#include "boost/type_traits/is_reference.hpp" +#include "boost/mpl/assert.hpp" +#include "boost/mpl/if.hpp" #include @@ -352,6 +356,55 @@ void test_break_const() BOOST_CHECK(i == 3); } +template +struct func { + template + struct sig { + typedef typename boost::tuples::element<1, Args>::type arg1; + // If the argument type is not the same as the expected type, + // return void, which will cause an error. Note that we + // can't just assert that the types are the same, because + // both const and non-const versions can be instantiated + // even though only one is ultimately used. + typedef typename boost::mpl::if_, + typename boost::remove_const::type, + void + >::type type; + }; + template + U operator()(const U& arg) const { + return arg; + } +}; + +void test_sig() +{ + int i = 1; + BOOST_CHECK(bind(func(), 1)() == 1); + BOOST_CHECK(bind(func(), _1)(static_cast(i)) == 1); + BOOST_CHECK(bind(func(), _1)(i) == 1); +} + +class base { +public: + virtual int foo() = 0; +}; + +class derived : public base { +public: + virtual int foo() { + return 1; + } +}; + +void test_abstract() +{ + derived d; + base& b = d; + BOOST_CHECK(bind(&base::foo, var(b))() == 1); + BOOST_CHECK(bind(&base::foo, *_1)(&b) == 1); +} + int test_main(int, char *[]) { test_nested_binds(); @@ -361,17 +414,7 @@ int test_main(int, char *[]) { test_const_parameters(); test_rvalue_arguments(); test_break_const(); + test_sig(); + test_abstract(); return 0; } - - - - - - - - - - - - diff --git a/test/result_of_tests.cpp b/test/result_of_tests.cpp new file mode 100644 index 0000000..9047f5b --- /dev/null +++ b/test/result_of_tests.cpp @@ -0,0 +1,314 @@ +// result_of_tests.cpp -- The Boost Lambda Library ------------------ +// +// Copyright (C) 2010 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 + +// ----------------------------------------------------------------------- + + +#include // see "Header Implementation Option" +#include +#include +#include +#include + +struct with_result_type { + typedef int result_type; + int operator()() const { return 0; } + int operator()(int) const { return 1; } + int operator()(int, int) const { return 2; } + int operator()(int, int, int) const { return 3; } + int operator()(int, int, int, int) const { return 4; } + int operator()(int, int, int, int, int) const { return 5; } + int operator()(int, int, int, int, int, int) const { return 6; } + int operator()(int, int, int, int, int, int, int) const { return 7; } + int operator()(int, int, int, int, int, int, int, int) const { return 8; } + int operator()(int, int, int, int, int, int, int, int, int) const { return 9; } +}; + +struct with_result_template_value { + template + struct result; + template + struct result { + typedef int type; + }; + template + struct result { + BOOST_MPL_ASSERT((boost::is_same)); + typedef int type; + }; + template + struct result { + BOOST_MPL_ASSERT((boost::is_same)); + BOOST_MPL_ASSERT((boost::is_same)); + typedef int type; + }; + template + struct result { + BOOST_MPL_ASSERT((boost::is_same)); + BOOST_MPL_ASSERT((boost::is_same)); + BOOST_MPL_ASSERT((boost::is_same)); + typedef int type; + }; + template + struct result { + BOOST_MPL_ASSERT((boost::is_same)); + BOOST_MPL_ASSERT((boost::is_same)); + BOOST_MPL_ASSERT((boost::is_same)); + BOOST_MPL_ASSERT((boost::is_same)); + typedef int type; + }; + template + struct result { + BOOST_MPL_ASSERT((boost::is_same)); + BOOST_MPL_ASSERT((boost::is_same)); + BOOST_MPL_ASSERT((boost::is_same)); + BOOST_MPL_ASSERT((boost::is_same)); + BOOST_MPL_ASSERT((boost::is_same)); + typedef int type; + }; + template + struct result { + BOOST_MPL_ASSERT((boost::is_same)); + BOOST_MPL_ASSERT((boost::is_same)); + BOOST_MPL_ASSERT((boost::is_same)); + BOOST_MPL_ASSERT((boost::is_same)); + BOOST_MPL_ASSERT((boost::is_same)); + BOOST_MPL_ASSERT((boost::is_same)); + typedef int type; + }; + template + struct result { + BOOST_MPL_ASSERT((boost::is_same)); + BOOST_MPL_ASSERT((boost::is_same)); + BOOST_MPL_ASSERT((boost::is_same)); + BOOST_MPL_ASSERT((boost::is_same)); + BOOST_MPL_ASSERT((boost::is_same)); + BOOST_MPL_ASSERT((boost::is_same)); + BOOST_MPL_ASSERT((boost::is_same)); + typedef int type; + }; + template + struct result { + BOOST_MPL_ASSERT((boost::is_same)); + BOOST_MPL_ASSERT((boost::is_same)); + BOOST_MPL_ASSERT((boost::is_same)); + BOOST_MPL_ASSERT((boost::is_same)); + BOOST_MPL_ASSERT((boost::is_same)); + BOOST_MPL_ASSERT((boost::is_same)); + BOOST_MPL_ASSERT((boost::is_same)); + BOOST_MPL_ASSERT((boost::is_same)); + typedef int type; + }; + template + struct result { + BOOST_MPL_ASSERT((boost::is_same)); + BOOST_MPL_ASSERT((boost::is_same)); + BOOST_MPL_ASSERT((boost::is_same)); + BOOST_MPL_ASSERT((boost::is_same)); + BOOST_MPL_ASSERT((boost::is_same)); + BOOST_MPL_ASSERT((boost::is_same)); + BOOST_MPL_ASSERT((boost::is_same)); + BOOST_MPL_ASSERT((boost::is_same)); + BOOST_MPL_ASSERT((boost::is_same)); + typedef int type; + }; + + int operator()() const { return 0; } + int operator()(int) const { return 1; } + int operator()(int, int) const { return 2; } + int operator()(int, int, int) const { return 3; } + int operator()(int, int, int, int) const { return 4; } + int operator()(int, int, int, int, int) const { return 5; } + int operator()(int, int, int, int, int, int) const { return 6; } + int operator()(int, int, int, int, int, int, int) const { return 7; } + int operator()(int, int, int, int, int, int, int, int) const { return 8; } + int operator()(int, int, int, int, int, int, int, int, int) const { return 9; } +}; + +struct with_result_template_reference { + template + struct result; + template + struct result { + typedef int type; + }; + template + struct result { + BOOST_MPL_ASSERT((boost::is_same)); + typedef int type; + }; + template + struct result { + BOOST_MPL_ASSERT((boost::is_same)); + BOOST_MPL_ASSERT((boost::is_same)); + typedef int type; + }; + template + struct result { + BOOST_MPL_ASSERT((boost::is_same)); + BOOST_MPL_ASSERT((boost::is_same)); + BOOST_MPL_ASSERT((boost::is_same)); + typedef int type; + }; + template + struct result { + BOOST_MPL_ASSERT((boost::is_same)); + BOOST_MPL_ASSERT((boost::is_same)); + BOOST_MPL_ASSERT((boost::is_same)); + BOOST_MPL_ASSERT((boost::is_same)); + typedef int type; + }; + template + struct result { + BOOST_MPL_ASSERT((boost::is_same)); + BOOST_MPL_ASSERT((boost::is_same)); + BOOST_MPL_ASSERT((boost::is_same)); + BOOST_MPL_ASSERT((boost::is_same)); + BOOST_MPL_ASSERT((boost::is_same)); + typedef int type; + }; + template + struct result { + BOOST_MPL_ASSERT((boost::is_same)); + BOOST_MPL_ASSERT((boost::is_same)); + BOOST_MPL_ASSERT((boost::is_same)); + BOOST_MPL_ASSERT((boost::is_same)); + BOOST_MPL_ASSERT((boost::is_same)); + BOOST_MPL_ASSERT((boost::is_same)); + typedef int type; + }; + template + struct result { + BOOST_MPL_ASSERT((boost::is_same)); + BOOST_MPL_ASSERT((boost::is_same)); + BOOST_MPL_ASSERT((boost::is_same)); + BOOST_MPL_ASSERT((boost::is_same)); + BOOST_MPL_ASSERT((boost::is_same)); + BOOST_MPL_ASSERT((boost::is_same)); + BOOST_MPL_ASSERT((boost::is_same)); + typedef int type; + }; + template + struct result { + BOOST_MPL_ASSERT((boost::is_same)); + BOOST_MPL_ASSERT((boost::is_same)); + BOOST_MPL_ASSERT((boost::is_same)); + BOOST_MPL_ASSERT((boost::is_same)); + BOOST_MPL_ASSERT((boost::is_same)); + BOOST_MPL_ASSERT((boost::is_same)); + BOOST_MPL_ASSERT((boost::is_same)); + BOOST_MPL_ASSERT((boost::is_same)); + typedef int type; + }; + template + struct result { + BOOST_MPL_ASSERT((boost::is_same)); + BOOST_MPL_ASSERT((boost::is_same)); + BOOST_MPL_ASSERT((boost::is_same)); + BOOST_MPL_ASSERT((boost::is_same)); + BOOST_MPL_ASSERT((boost::is_same)); + BOOST_MPL_ASSERT((boost::is_same)); + BOOST_MPL_ASSERT((boost::is_same)); + BOOST_MPL_ASSERT((boost::is_same)); + BOOST_MPL_ASSERT((boost::is_same)); + typedef int type; + }; + + int operator()() const { return 0; } + int operator()(int) const { return 1; } + int operator()(int, int) const { return 2; } + int operator()(int, int, int) const { return 3; } + int operator()(int, int, int, int) const { return 4; } + int operator()(int, int, int, int, int) const { return 5; } + int operator()(int, int, int, int, int, int) const { return 6; } + int operator()(int, int, int, int, int, int, int) const { return 7; } + int operator()(int, int, int, int, int, int, int, int) const { return 8; } + int operator()(int, int, int, int, int, int, int, int, int) const { return 9; } +}; + +template +typename boost::result_of::type apply0(F f) { + return f(); +} +template +typename boost::result_of::type apply1(F f, A a) { + return f(a); +} +template +typename boost::result_of::type apply2(F f, A a, B b) { + return f(a, b); +} +template +typename boost::result_of::type apply3(F f, A a, B b, C c) { + return f(a, b, c); +} + +using namespace boost::lambda; + +int test_main(int, char *[]) { + BOOST_CHECK(boost::lambda::bind(with_result_type())() == 0); + BOOST_CHECK(boost::lambda::bind(with_result_type(), 1)() == 1); + BOOST_CHECK(boost::lambda::bind(with_result_type(), 1, 2)() == 2); + BOOST_CHECK(boost::lambda::bind(with_result_type(), 1, 2, 3)() == 3); + BOOST_CHECK(boost::lambda::bind(with_result_type(), 1, 2, 3, 4)() == 4); + BOOST_CHECK(boost::lambda::bind(with_result_type(), 1, 2, 3, 4, 5)() == 5); + BOOST_CHECK(boost::lambda::bind(with_result_type(), 1, 2, 3, 4, 5, 6)() == 6); + BOOST_CHECK(boost::lambda::bind(with_result_type(), 1, 2, 3, 4, 5, 6, 7)() == 7); + BOOST_CHECK(boost::lambda::bind(with_result_type(), 1, 2, 3, 4, 5, 6, 7, 8)() == 8); + BOOST_CHECK(boost::lambda::bind(with_result_type(), 1, 2, 3, 4, 5, 6, 7, 8, 9)() == 9); + + // Nullary result_of fails + //BOOST_CHECK(boost::lambda::bind(with_result_template_value())() == 0); + BOOST_CHECK(boost::lambda::bind(with_result_template_value(), 1)() == 1); + BOOST_CHECK(boost::lambda::bind(with_result_template_value(), 1, 2)() == 2); + BOOST_CHECK(boost::lambda::bind(with_result_template_value(), 1, 2, 3)() == 3); + BOOST_CHECK(boost::lambda::bind(with_result_template_value(), 1, 2, 3, 4)() == 4); + BOOST_CHECK(boost::lambda::bind(with_result_template_value(), 1, 2, 3, 4, 5)() == 5); + BOOST_CHECK(boost::lambda::bind(with_result_template_value(), 1, 2, 3, 4, 5, 6)() == 6); + BOOST_CHECK(boost::lambda::bind(with_result_template_value(), 1, 2, 3, 4, 5, 6, 7)() == 7); + BOOST_CHECK(boost::lambda::bind(with_result_template_value(), 1, 2, 3, 4, 5, 6, 7, 8)() == 8); + BOOST_CHECK(boost::lambda::bind(with_result_template_value(), 1, 2, 3, 4, 5, 6, 7, 8, 9)() == 9); + + int one = 1, + two = 2, + three = 3, + four = 4, + five = 5, + six = 6, + seven = 7, + eight = 8, + nine = 9; + + // Nullary result_of fails + //BOOST_CHECK(boost::lambda::bind(with_result_template_reference())() == 0); + BOOST_CHECK(boost::lambda::bind(with_result_template_reference(), var(one))() == 1); + BOOST_CHECK(boost::lambda::bind(with_result_template_reference(), var(one), var(two))() == 2); + BOOST_CHECK(boost::lambda::bind(with_result_template_reference(), var(one), var(two), var(three))() == 3); + BOOST_CHECK(boost::lambda::bind(with_result_template_reference(), var(one), var(two), var(three), var(four))() == 4); + BOOST_CHECK(boost::lambda::bind(with_result_template_reference(), var(one), var(two), var(three), var(four), var(five))() == 5); + BOOST_CHECK(boost::lambda::bind(with_result_template_reference(), var(one), var(two), var(three), var(four), var(five), var(six))() == 6); + BOOST_CHECK(boost::lambda::bind(with_result_template_reference(), var(one), var(two), var(three), var(four), var(five), var(six), var(seven))() == 7); + BOOST_CHECK(boost::lambda::bind(with_result_template_reference(), var(one), var(two), var(three), var(four), var(five), var(six), var(seven), var(eight))() == 8); + BOOST_CHECK(boost::lambda::bind(with_result_template_reference(), var(one), var(two), var(three), var(four), var(five), var(six), var(seven), var(eight), var(nine))() == 9); + + // Check using result_of with lambda functors + //BOOST_CHECK(apply0(constant(0)) == 0); + BOOST_CHECK(apply1(_1, one) == 1); + BOOST_CHECK(apply1(_1, one) == 1); + BOOST_CHECK(apply1(_1, one) == 1); + BOOST_CHECK((apply2(_1 + _2, one, two) == 3)); + BOOST_CHECK((apply2(_1 + _2, one, two) == 3)); + BOOST_CHECK((apply2(_1 + _2, one, two) == 3)); + BOOST_CHECK((apply3(_1 + _2 + _3, one, two, three) == 6)); + BOOST_CHECK((apply3(_1 + _2 + _3, one, two, three) == 6)); + BOOST_CHECK((apply3(_1 + _2 + _3, one, two, three) == 6)); + + return 0; +} From 57a605d7cc69157653b94a157dbc2c6f71ff565a Mon Sep 17 00:00:00 2001 From: Steven Watanabe Date: Wed, 9 Jun 2010 02:10:06 +0000 Subject: [PATCH 35/42] Revert [62617], since there is already a Jamfile for Lambda's tests [SVN r62628] --- test/Jamfile.v2 | 45 --------------------------------------------- 1 file changed, 45 deletions(-) delete mode 100644 test/Jamfile.v2 diff --git a/test/Jamfile.v2 b/test/Jamfile.v2 deleted file mode 100644 index d3e1640..0000000 --- a/test/Jamfile.v2 +++ /dev/null @@ -1,45 +0,0 @@ -# Lambda library - -# Copyright (C) 2001-2007 Jaakko Järvi, Daniel Walker - -# Use, modification and distribution is subject to 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 http://www.boost.org/ - -# bring in rules for testing -import testing ; - -test-suite lambda - : - [ run algorithm_test.cpp ] - - [ run bind_tests_simple.cpp ] - - [ run bind_tests_advanced.cpp ] - - [ run bind_tests_simple_f_refs.cpp ] - - [ run bll_and_function.cpp ] - - [ run cast_test.cpp ] - - [ run constructor_tests.cpp ] - - [ run control_structures.cpp ] - - [ run exception_test.cpp ] - - [ run extending_rt_traits.cpp ] - - [ run is_instance_of_test.cpp ] - - [ run member_pointer_test.cpp ] - - [ run operator_tests_simple.cpp ] - - [ run phoenix_control_structures.cpp ] - - [ run switch_construct.cpp ] - ; From 45c6ba535c3393c2bd67417343acb4204dcd7782 Mon Sep 17 00:00:00 2001 From: Daniel James Date: Sun, 20 Jun 2010 18:00:48 +0000 Subject: [PATCH 36/42] Update various libraries' documentation build. Mostly to use the images and css files under doc/src instead of doc/html, usually be deleting the settings in order to use the defaults. Also add 'boost.root' to some builds in order to fix links which rely on it. [SVN r63146] --- doc/Jamfile.v2 | 1 + 1 file changed, 1 insertion(+) diff --git a/doc/Jamfile.v2 b/doc/Jamfile.v2 index 36f3fcf..1723bb7 100644 --- a/doc/Jamfile.v2 +++ b/doc/Jamfile.v2 @@ -6,6 +6,7 @@ path-constant images : ../../spirit/phoenix/doc/html ; boostbook lambda-doc : lambda.xml : + boost.root=../../../.. pdf:img.src.path=$(images)/ ; From 4091f55a4b9d32fb255df92fd0ee17200028e44a Mon Sep 17 00:00:00 2001 From: Daniel Walker Date: Wed, 7 Jul 2010 20:44:59 +0000 Subject: [PATCH 37/42] removed arity detection from has_xxx_template [SVN r63726] --- include/boost/lambda/detail/function_adaptors.hpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/include/boost/lambda/detail/function_adaptors.hpp b/include/boost/lambda/detail/function_adaptors.hpp index cfe3b07..58c6b50 100644 --- a/include/boost/lambda/detail/function_adaptors.hpp +++ b/include/boost/lambda/detail/function_adaptors.hpp @@ -23,7 +23,7 @@ namespace lambda { namespace detail { -BOOST_MPL_HAS_XXX_TEMPLATE_NAMED_DEF(has_template_sig, sig, 1, true) +BOOST_MPL_HAS_XXX_TEMPLATE_DEF(sig) template struct remove_references_from_elements { @@ -160,7 +160,7 @@ template struct function_adaptor { : result_converter< Args , tuples::length::value - , detail::has_template_sig::value + , detail::has_sig::value > {}; #else // BOOST_NO_RESULT_OF From 2ed8d7f4dfd0b56509a6d915d9824a985ee5df9a Mon Sep 17 00:00:00 2001 From: Steven Watanabe Date: Mon, 3 Jan 2011 22:31:21 +0000 Subject: [PATCH 38/42] Fix return type deduction for pointers to data members. Fixes #4962. Fixes #4566. [SVN r67640] --- .../boost/lambda/detail/function_adaptors.hpp | 17 ++++++++++++----- test/bind_tests_simple.cpp | 17 +++++++++++++++++ 2 files changed, 29 insertions(+), 5 deletions(-) diff --git a/include/boost/lambda/detail/function_adaptors.hpp b/include/boost/lambda/detail/function_adaptors.hpp index 58c6b50..35db8b4 100644 --- a/include/boost/lambda/detail/function_adaptors.hpp +++ b/include/boost/lambda/detail/function_adaptors.hpp @@ -16,6 +16,9 @@ #include "boost/tuple/tuple.hpp" #include "boost/type_traits/same_traits.hpp" #include "boost/type_traits/remove_reference.hpp" +#include "boost/type_traits/remove_cv.hpp" +#include "boost/type_traits/add_const.hpp" +#include "boost/type_traits/add_volatile.hpp" #include "boost/utility/result_of.hpp" namespace boost { @@ -237,22 +240,26 @@ struct function_adaptor { // the data member is accessed is const, and finally adding a reference template class sig { typedef typename boost::tuples::element<1, Args>::type argument_type; + typedef typename boost::remove_reference< + argument_type + >::type unref_type; - typedef typename detail::IF::value, + typedef typename detail::IF::value, typename boost::add_const::type, T >::RET properly_consted_return_type; - typedef typename detail::IF< - boost::is_volatile::value, + typedef typename detail::IF::value, typename boost::add_volatile::type, properly_consted_return_type >::RET properly_cvd_return_type; public: - typedef typename - boost::add_reference::type type; + typedef typename detail::IF::value, + typename boost::add_reference::type, + typename boost::remove_cv::type + >::RET type; }; template diff --git a/test/bind_tests_simple.cpp b/test/bind_tests_simple.cpp index d9a05fa..1e63d69 100644 --- a/test/bind_tests_simple.cpp +++ b/test/bind_tests_simple.cpp @@ -80,6 +80,23 @@ void test_member_functions() // bind(&A::add, a, _1); } +struct B { + B(int n) : i(n) {}; + int i; +}; + +void test_data_members() +{ + using boost::ref; + B b(10); + BOOST_CHECK(bind(&B::i, ref(b))() == 10); + BOOST_CHECK(bind(&B::i, b)() == 10); + BOOST_CHECK(bind(&B::i, _1)(b) == 10); + BOOST_CHECK(bind(&B::i, _1)(B(11)) == 11); + bind(&B::i, ref(b))() = 1; + BOOST_CHECK(b.i == 1); +} + int test_main(int, char *[]) { int i = 1; int j = 2; int k = 3; From 9c376db7e5d44dc2c52bebcecb344aa050021b17 Mon Sep 17 00:00:00 2001 From: Marshall Clow Date: Fri, 28 Dec 2012 16:51:09 +0000 Subject: [PATCH 39/42] Fixed 'the the' in comments; Refs #7714 [SVN r82235] --- include/boost/lambda/if.hpp | 2 +- include/boost/lambda/loops.hpp | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/include/boost/lambda/if.hpp b/include/boost/lambda/if.hpp index 9ee915c..08f45f9 100644 --- a/include/boost/lambda/if.hpp +++ b/include/boost/lambda/if.hpp @@ -345,7 +345,7 @@ public: // is true, the true_statement (again an lambda_functor) is executed // otherwise, the false_statement (another lambda_functor) is executed. The // result type of this is void. Note the trailing underscore after -// if_ and the the leading dot and the trailing underscore before +// if_ and the leading dot and the trailing underscore before // and after .else_. // /////////////////////////////////////////////////////////////////////////////// diff --git a/include/boost/lambda/loops.hpp b/include/boost/lambda/loops.hpp index 4e9b60b..bd85694 100644 --- a/include/boost/lambda/loops.hpp +++ b/include/boost/lambda/loops.hpp @@ -348,7 +348,7 @@ while_(CondT const& cond) // While the condition (an lambda_functor) evaluates to true, statement // (another lambda_functor) is executed. The statement is executed at least // once. The result type of this is void. Note the trailing -// underscore after do_ and the the leading dot and the trailing +// underscore after do_ and the leading dot and the trailing // underscore before and after .while_. // /////////////////////////////////////////////////////////////////////////////// From fab5a8041beea61fc0dc4986caf286fd0857e9c0 Mon Sep 17 00:00:00 2001 From: Steven Watanabe Date: Sat, 16 Feb 2013 20:01:07 +0000 Subject: [PATCH 40/42] Remove name of unused parameter. Fixes #8033. [SVN r82932] --- include/boost/lambda/detail/ret.hpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/include/boost/lambda/detail/ret.hpp b/include/boost/lambda/detail/ret.hpp index fbd8b3a..96f5fc1 100644 --- a/include/boost/lambda/detail/ret.hpp +++ b/include/boost/lambda/detail/ret.hpp @@ -284,7 +284,7 @@ inline const lambda_functor< lambda_functor_base > -make_void(const Arg1& a1) { +make_void(const Arg1&) { return lambda_functor_base(); } From 657a0b9dd71b266779ca08a395eb7776729760cb Mon Sep 17 00:00:00 2001 From: Steven Watanabe Date: Sat, 16 Feb 2013 20:26:34 +0000 Subject: [PATCH 41/42] Handle nullary result_of. Fixes #6914. [SVN r82935] --- .../boost/lambda/detail/lambda_functors.hpp | 21 +++++++++++++++++++ test/result_of_tests.cpp | 2 +- 2 files changed, 22 insertions(+), 1 deletion(-) diff --git a/include/boost/lambda/detail/lambda_functors.hpp b/include/boost/lambda/detail/lambda_functors.hpp index 9b1b082..db229ec 100644 --- a/include/boost/lambda/detail/lambda_functors.hpp +++ b/include/boost/lambda/detail/lambda_functors.hpp @@ -15,6 +15,7 @@ #include #include +#include #if BOOST_WORKAROUND(BOOST_MSVC, == 1310) @@ -297,6 +298,26 @@ public: } // namespace lambda } // namespace boost +namespace boost { + +#if !defined(BOOST_RESULT_OF_USE_DECLTYPE) || defined(BOOST_NO_DECLTYPE) + +template +struct result_of()> +{ + typedef typename boost::lambda::lambda_functor::nullary_return_type type; +}; + +#endif + +template +struct tr1_result_of()> +{ + typedef typename boost::lambda::lambda_functor::nullary_return_type type; +}; + +} + // is_placeholder #include diff --git a/test/result_of_tests.cpp b/test/result_of_tests.cpp index 9047f5b..c8da329 100644 --- a/test/result_of_tests.cpp +++ b/test/result_of_tests.cpp @@ -299,7 +299,7 @@ int test_main(int, char *[]) { BOOST_CHECK(boost::lambda::bind(with_result_template_reference(), var(one), var(two), var(three), var(four), var(five), var(six), var(seven), var(eight), var(nine))() == 9); // Check using result_of with lambda functors - //BOOST_CHECK(apply0(constant(0)) == 0); + BOOST_CHECK(apply0(constant(0)) == 0); BOOST_CHECK(apply1(_1, one) == 1); BOOST_CHECK(apply1(_1, one) == 1); BOOST_CHECK(apply1(_1, one) == 1); From 4545234f942155fabd9cac0d74021deb4fbfbfd8 Mon Sep 17 00:00:00 2001 From: Steven Watanabe Date: Tue, 19 Feb 2013 19:52:03 +0000 Subject: [PATCH 42/42] Handle const lambda functors for nullary result_of. Fixes #6914. [SVN r83020] --- include/boost/lambda/detail/lambda_functors.hpp | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/include/boost/lambda/detail/lambda_functors.hpp b/include/boost/lambda/detail/lambda_functors.hpp index db229ec..9ce29ad 100644 --- a/include/boost/lambda/detail/lambda_functors.hpp +++ b/include/boost/lambda/detail/lambda_functors.hpp @@ -308,6 +308,12 @@ struct result_of()> typedef typename boost::lambda::lambda_functor::nullary_return_type type; }; +template +struct result_of()> +{ + typedef typename boost::lambda::lambda_functor::nullary_return_type type; +}; + #endif template @@ -316,6 +322,12 @@ struct tr1_result_of()> typedef typename boost::lambda::lambda_functor::nullary_return_type type; }; +template +struct tr1_result_of()> +{ + typedef typename boost::lambda::lambda_functor::nullary_return_type type; +}; + } // is_placeholder