2
0
mirror of https://github.com/boostorg/lambda.git synced 2026-01-24 05:52:17 +00:00

Compare commits

..

17 Commits

Author SHA1 Message Date
Beman Dawes
871a5587e2 Release 1.39.0
[SVN r52732]
2009-05-02 13:01:04 +00:00
Steven Watanabe
7648a7adf1 Merge [51448] from the trunk.
[SVN r51617]
2009-03-05 03:52:26 +00:00
John Maddock
48e6f45d92 Merge PDF build changes from Trunk.
[SVN r51417]
2009-02-23 18:39:32 +00:00
Steven Watanabe
927a04351e Merge [50516] and [50999] from the trunk. These are the fixes for #781 and #2446 respectively
[SVN r51368]
2009-02-21 18:10:20 +00:00
Troy D. Straszheim
b5b41af8f4 merge of cmake build files from trunk per beman
[SVN r50756]
2009-01-24 18:57:20 +00:00
Marshall Clow
1f6ca994e6 Merged revisions 50413 via svnmerge from
https://svn.boost.org/svn/boost/trunk

........
  r50413 | marshall | 2008-12-30 10:27:43 -0800 (Tue, 30 Dec 2008) | 1 line
  
  Typo: fixes bug #2583
........


[SVN r50602]
2009-01-15 03:46:14 +00:00
Beman Dawes
4a254c4161 With his kind permission, change Jaakko "Järvi" to "Jarvi"
[SVN r46809]
2008-06-28 13:57:20 +00:00
Beman Dawes
e67976c740 Full merge from trunk at revision 41356 of entire boost-root tree.
[SVN r41370]
2007-11-25 18:38:02 +00:00
Beman Dawes
a0cd34c938 Full merge from trunk at revision 41356 of entire boost-root tree.
[SVN r41369]
2007-11-25 18:07:19 +00:00
Beman Dawes
672c8e10d4 Starting point for releases
[SVN r39706]
2007-10-05 14:25:06 +00:00
nobody
87dd3997e7 This commit was manufactured by cvs2svn to create tag
'Version_1_34_1'.

[SVN r38286]
2007-07-24 19:28:14 +00:00
Daniel James
b112fb9254 Fix a link.
[SVN r36651]
2007-01-07 22:42:25 +00:00
Jaakko Järvi
13ec0c5bbc fixed omission
[SVN r36201]
2006-11-29 19:28:48 +00:00
Jaakko Järvi
29ab5a2814 fixed bug 1444052
[SVN r36200]
2006-11-29 19:21:46 +00:00
Beman Dawes
a0cfe43611 Merged copyright and license addition
[SVN r35907]
2006-11-07 19:27:00 +00:00
Rene Rivera
fe858cf734 Remove obsolete Boost.Build v1 files.
[SVN r35880]
2006-11-06 17:10:46 +00:00
nobody
b3120233dc This commit was manufactured by cvs2svn to create branch 'RC_1_34_0'.
[SVN r33417]
2006-03-21 02:26:31 +00:00
6 changed files with 30 additions and 51 deletions

View File

@@ -44,7 +44,7 @@
<para>
The Boost Lambda Library (BLL in the sequel) is a C++ template
library, which implements a form of <emphasis>lambda abstractions</emphasis> for C++.
library, which implements form of <emphasis>lambda abstractions</emphasis> 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.
@@ -3191,7 +3191,7 @@ to extend the library with new features.
<section>
<appendix>
<title>Rationale for some of the design decisions</title>
<section id="lambda.why_weak_arity">
@@ -3256,7 +3256,7 @@ was dropped.
</section>
</section>
</appendix>

View File

@@ -13,30 +13,6 @@
#ifndef BOOST_LAMBDA_LAMBDA_FUNCTORS_HPP
#define BOOST_LAMBDA_LAMBDA_FUNCTORS_HPP
#include <boost/config.hpp>
#include <boost/detail/workaround.hpp>
#if BOOST_WORKAROUND(BOOST_MSVC, == 1310)
#include <boost/mpl/or.hpp>
#include <boost/utility/enable_if.hpp>
#include <boost/type_traits/is_array.hpp>
#define BOOST_LAMBDA_DISABLE_IF_ARRAY1(A1, R1)\
typename lazy_disable_if<is_array<A1>, typename R1 >::type
#define BOOST_LAMBDA_DISABLE_IF_ARRAY2(A1, A2, R1, R2) \
typename lazy_disable_if<mpl::or_<is_array<A1>, is_array<A2> >, typename R1, R2 >::type
#define BOOST_LAMBDA_DISABLE_IF_ARRAY3(A1, A2, A3, R1, R2, R3) \
typename lazy_disable_if<mpl::or_<is_array<A1>, is_array<A2>, is_array<A3> >, 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 {
@@ -176,7 +152,7 @@ public:
}
template<class A>
BOOST_LAMBDA_DISABLE_IF_ARRAY1(A, inherited::template sig<tuple<A const&> >)
typename inherited::template sig<tuple<A const&> >::type
operator()(A const& a) const {
return inherited::template call<
typename inherited::template sig<tuple<A const&> >::type
@@ -192,7 +168,7 @@ public:
}
template<class A, class B>
BOOST_LAMBDA_DISABLE_IF_ARRAY2(A, B, inherited::template sig<tuple<A const&, B&> >)
typename inherited::template sig<tuple<A const&, B&> >::type
operator()(A const& a, B& b) const {
return inherited::template call<
typename inherited::template sig<tuple<A const&, B&> >::type
@@ -200,7 +176,7 @@ public:
}
template<class A, class B>
BOOST_LAMBDA_DISABLE_IF_ARRAY2(A, B, inherited::template sig<tuple<A&, B const&> >)
typename inherited::template sig<tuple<A&, B const&> >::type
operator()(A& a, B const& b) const {
return inherited::template call<
typename inherited::template sig<tuple<A&, B const&> >::type
@@ -208,7 +184,7 @@ public:
}
template<class A, class B>
BOOST_LAMBDA_DISABLE_IF_ARRAY2(A, B, inherited::template sig<tuple<A const&, B const&> >)
typename inherited::template sig<tuple<A const&, B const&> >::type
operator()(A const& a, B const& b) const {
return inherited::template call<
typename inherited::template sig<tuple<A const&, B const&> >::type
@@ -225,7 +201,7 @@ public:
}
template<class A, class B, class C>
BOOST_LAMBDA_DISABLE_IF_ARRAY3(A, B, C, inherited::template sig<tuple<A const&, B const&, C const&> >)
typename inherited::template sig<tuple<A const&, B const&, C const&> >::type
operator()(A const& a, B const& b, C const& c) const
{
return inherited::template call<

View File

@@ -27,8 +27,7 @@
#include <algorithm>
using namespace boost::lambda;
namespace bl = boost::lambda;
using namespace boost::lambda;
int sum_0() { return 0; }
int sum_1(int a) { return a; }
@@ -92,7 +91,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 bl::bind(unlambda(f), _1)(make_const(100));
return bind(unlambda(f), _1)(make_const(100));
// for other functors than lambda functors, unlambda has no effect
// (except for making them const)
@@ -117,11 +116,11 @@ void test_unlambda() {
BOOST_CHECK(call_with_101(_1 + 1) == 102);
BOOST_CHECK(call_with_100(bl::bind(std_functor(std::bind1st(std::plus<int>(), 1)), _1)) == 101);
BOOST_CHECK(call_with_100(bind(std_functor(std::bind1st(std::plus<int>(), 1)), _1)) == 101);
// std_functor insturcts LL that the functor defines a result_type typedef
// rather than a sig template.
bl::bind(std_functor(std::plus<int>()), _1, _2)(i, i);
bind(std_functor(std::plus<int>()), _1, _2)(i, i);
}

View File

@@ -18,7 +18,9 @@
#include <iostream>
using namespace boost::lambda;
using namespace std;
using namespace boost::lambda;
int sum_of_args_0() { return 0; }

View File

@@ -18,7 +18,9 @@
#include <iostream>
using namespace boost::lambda;
using namespace std;
using namespace boost::lambda;
int sum_of_args_0() { return 0; }

View File

@@ -29,7 +29,7 @@
#endif
using namespace boost::lambda;
namespace bl = boost::lambda;
using namespace std;
template<class T>
bool check_tuple(int n, const T& t)
@@ -212,17 +212,17 @@ int count_deletes::count = 0;
void test_news_and_deletes ()
{
int* i[10];
std::for_each(i, i+10, _1 = bind(new_ptr<int>(), 2));
for_each(i, i+10, _1 = bind(new_ptr<int>(), 2));
int count_errors = 0;
std::for_each(i, i+10, (*_1 == 2) || ++var(count_errors));
for_each(i, i+10, (*_1 == 2) || ++var(count_errors));
BOOST_CHECK(count_errors == 0);
count_deletes* ct[10];
std::for_each(ct, ct+10, _1 = bind(new_ptr<count_deletes>()));
for_each(ct, ct+10, _1 = bind(new_ptr<count_deletes>()));
count_deletes::count = 0;
std::for_each(ct, ct+10, bind(delete_ptr(), _1));
for_each(ct, ct+10, bind(delete_ptr(), _1));
BOOST_CHECK(count_deletes::count == 10);
}
@@ -240,16 +240,16 @@ void test_array_new_and_delete()
void delayed_construction()
{
std::vector<int> x(3);
std::vector<int> y(3);
vector<int> x(3);
vector<int> y(3);
std::fill(x.begin(), x.end(), 0);
std::fill(y.begin(), y.end(), 1);
fill(x.begin(), x.end(), 0);
fill(y.begin(), y.end(), 1);
std::vector<std::pair<int, int> > v;
vector<pair<int, int> > v;
std::transform(x.begin(), x.end(), y.begin(), std::back_inserter(v),
bl::bind(constructor<std::pair<int, int> >(), _1, _2) );
transform(x.begin(), x.end(), y.begin(), back_inserter(v),
bind(constructor<pair<int, int> >(), _1, _2) );
}
int test_main(int, char *[]) {