Ticket #3025: constructor_tests.patch

File constructor_tests.patch, 1.7 KB (added by Richard Webb <richard.webb@…>, 13 years ago)
  • constructor_tests.cpp

     
    2929#endif
    3030
    3131using namespace boost::lambda;
    32 using namespace std;
    3332
    3433template<class T>
    3534bool check_tuple(int n, const T& t)
     
    212211void test_news_and_deletes ()
    213212{
    214213  int* i[10];
    215   for_each(i, i+10, _1 = bind(new_ptr<int>(), 2));
     214  std::for_each(i, i+10, _1 = bind(new_ptr<int>(), 2));
    216215  int count_errors = 0;
    217216
    218   for_each(i, i+10, (*_1 == 2) || ++var(count_errors));
     217  std::for_each(i, i+10, (*_1 == 2) || ++var(count_errors));
    219218  BOOST_CHECK(count_errors == 0);
    220219
    221220
    222221  count_deletes* ct[10];
    223   for_each(ct, ct+10, _1 = bind(new_ptr<count_deletes>()));
     222  std::for_each(ct, ct+10, _1 = bind(new_ptr<count_deletes>()));
    224223  count_deletes::count = 0;
    225   for_each(ct, ct+10, bind(delete_ptr(), _1));
     224  std::for_each(ct, ct+10, bind(delete_ptr(), _1));
    226225  BOOST_CHECK(count_deletes::count == 10);
    227226   
    228227}
     
    240239
    241240void delayed_construction()
    242241{
    243   vector<int> x(3);
    244   vector<int> y(3);
     242  std::vector<int> x(3);
     243  std::vector<int> y(3);
    245244
    246   fill(x.begin(), x.end(), 0);
    247   fill(y.begin(), y.end(), 1);
     245  std::fill(x.begin(), x.end(), 0);
     246  std::fill(y.begin(), y.end(), 1);
    248247 
    249   vector<pair<int, int> > v;
     248  std::vector<std::pair<int, int> > v;
    250249
    251   transform(x.begin(), x.end(), y.begin(), back_inserter(v),
    252             bind(constructor<pair<int, int> >(), _1, _2) );
     250  std::transform(x.begin(), x.end(), y.begin(), std::back_inserter(v),
     251            bind(constructor<std::pair<int, int> >(), _1, _2) );
    253252}
    254253
    255254int test_main(int, char *[]) {