Lines Matching defs:array
55 int array [3] = { 1, 2, 3 };
56 int* p = remove_if((int*)array, (int*)array + 3, bind1st(less<int>(), 2));
58 CPPUNIT_ASSERT(p == &array[2]);
59 CPPUNIT_ASSERT(array[0] == 1);
60 CPPUNIT_ASSERT(array[1] == 2);
62 for_each((int*)array, (int*)array + 3, bind1st(pre_increment(), 1));
63 CPPUNIT_ASSERT(array[0] == 2);
64 CPPUNIT_ASSERT(array[1] == 3);
65 CPPUNIT_ASSERT(array[2] == 4);
67 for_each((int*)array, (int*)array + 3, bind2nd(post_increment(), 1));
68 CPPUNIT_ASSERT(array[0] == 3);
69 CPPUNIT_ASSERT(array[1] == 4);
70 CPPUNIT_ASSERT(array[2] == 5);
75 int array [3] = { 1, 2, 3 };
76 replace_if(array, array + 3, binder2nd<greater<int> >(greater<int>(), 2), 4);
78 CPPUNIT_ASSERT(array[0]==1);
79 CPPUNIT_ASSERT(array[1]==2);
80 CPPUNIT_ASSERT(array[2]==4);
84 int array [3] = { 1, 2, 3 };
85 replace_if(array, array + 3, bind2nd(greater<int>(), 2), 4);
86 CPPUNIT_ASSERT(array[0]==1);
87 CPPUNIT_ASSERT(array[1]==2);
88 CPPUNIT_ASSERT(array[2]==4);
104 int array[3] = { 1, 2, 3 };
105 transform(array, array + 3, array, bind2nd(ptr_fun(test_func1), 1));
106 transform(array, array + 3, array, bind1st(ptr_fun(test_func1), -1));
107 CPPUNIT_ASSERT(array[0] == 1);
108 CPPUNIT_ASSERT(array[1] == 2);
109 CPPUNIT_ASSERT(array[2] == 3);
111 transform(array, array + 3, array, bind2nd(ptr_fun(test_func2), 10));
112 CPPUNIT_ASSERT(array[0] == 21);
113 CPPUNIT_ASSERT(array[1] == 22);
114 CPPUNIT_ASSERT(array[2] == 23);
143 A array[3];
145 for_each( array, array + 3, bind2nd( mem_fun_ref(&A::f), 12 ) );
147 CPPUNIT_CHECK( array[0].v() == 12 );