Ticket #3025: constructor_tests.patch
File constructor_tests.patch, 1.7 KB (added by , 13 years ago) |
---|
-
constructor_tests.cpp
29 29 #endif 30 30 31 31 using namespace boost::lambda; 32 using namespace std;33 32 34 33 template<class T> 35 34 bool check_tuple(int n, const T& t) … … 212 211 void test_news_and_deletes () 213 212 { 214 213 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)); 216 215 int count_errors = 0; 217 216 218 for_each(i, i+10, (*_1 == 2) || ++var(count_errors));217 std::for_each(i, i+10, (*_1 == 2) || ++var(count_errors)); 219 218 BOOST_CHECK(count_errors == 0); 220 219 221 220 222 221 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>())); 224 223 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)); 226 225 BOOST_CHECK(count_deletes::count == 10); 227 226 228 227 } … … 240 239 241 240 void delayed_construction() 242 241 { 243 vector<int> x(3);244 vector<int> y(3);242 std::vector<int> x(3); 243 std::vector<int> y(3); 245 244 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); 248 247 249 vector<pair<int, int> > v;248 std::vector<std::pair<int, int> > v; 250 249 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) ); 253 252 } 254 253 255 254 int test_main(int, char *[]) {