Ticket #3075: lambda.diff

File lambda.diff, 2.7 KB (added by Richard Webb <richard.webb@…>, 13 years ago)
  • bind_tests_advanced.cpp

     
    2727#include <algorithm>
    2828
    2929
    30 using namespace boost::lambda;
     30using namespace boost::lambda;
     31namespace bl = boost::lambda;
    3132
    3233int sum_0() { return 0; }
    3334int sum_1(int a) { return a; }
     
    9192  // This would result in;
    9293  // bind(_1 + 1, _1)(make_const(100)) , which would be a compile time error
    9394
    94   return bind(unlambda(f), _1)(make_const(100));
     95  return bl::bind(unlambda(f), _1)(make_const(100));
    9596
    9697  // for other functors than lambda functors, unlambda has no effect
    9798  // (except for making them const)
     
    116117
    117118  BOOST_CHECK(call_with_101(_1 + 1) == 102);
    118119
    119   BOOST_CHECK(call_with_100(bind(std_functor(std::bind1st(std::plus<int>(), 1)), _1)) == 101);
     120  BOOST_CHECK(call_with_100(bl::bind(std_functor(std::bind1st(std::plus<int>(), 1)), _1)) == 101);
    120121
    121122  // std_functor insturcts LL that the functor defines a result_type typedef
    122123  // rather than a sig template.
    123   bind(std_functor(std::plus<int>()), _1, _2)(i, i);
     124  bl::bind(std_functor(std::plus<int>()), _1, _2)(i, i);
    124125}
    125126
    126127
  • bind_tests_simple.cpp

     
    1818
    1919#include <iostream>
    2020
     21using namespace boost::lambda;
    2122
    22   using namespace std;
    23   using namespace boost::lambda;
    2423
    25 
    2624int sum_of_args_0() { return 0; }
    2725int sum_of_args_1(int a) { return a; }
    2826int sum_of_args_2(int a, int b) { return a+b; }
  • bind_tests_simple_f_refs.cpp

     
    1818
    1919#include <iostream>
    2020
     21using namespace boost::lambda;
    2122
    22   using namespace std;
    23   using namespace boost::lambda;
    2423
    25 
    2624int sum_of_args_0() { return 0; }
    2725int sum_of_args_1(int a) { return a; }
    2826int sum_of_args_2(int a, int b) { return a+b; }
  • constructor_tests.cpp

     
    2929#endif
    3030
    3131using namespace boost::lambda;
     32namespace bl = boost::lambda;
    3233
    3334template<class T>
    3435bool check_tuple(int n, const T& t)
     
    248249  std::vector<std::pair<int, int> > v;
    249250
    250251  std::transform(x.begin(), x.end(), y.begin(), std::back_inserter(v),
    251             bind(constructor<std::pair<int, int> >(), _1, _2) );
     252            bl::bind(constructor<std::pair<int, int> >(), _1, _2) );
    252253}
    253254
    254255int test_main(int, char *[]) {