4 #define Array flower_vector
7 #define HAVE_BOOST_LAMBDA 1
8 #include "std-vector.hh"
16 #define vector flower_vector
25 for (vsize i
= 0; i
< v
.size (); i
++)
26 cout
<< "v[" << i
<< "] = " << v
[i
] << endl
;
33 print (Link_array
<T
> v
)
35 for (vsize i
= 0; i
< v
.size (); i
++)
36 cout
<< "v[" << i
<< "] = " << *v
[i
] << endl
;
46 EQUAL (v
.size (), vsize (2));
47 v
.erase (v
.begin () + 1);
48 EQUAL (v
.size (), vsize (1));
52 EQUAL (v
.size (), vsize (2));
53 v
.erase (v
.begin () + 0);
54 EQUAL (v
.size (), vsize (1));
66 EQUAL (v
.slice (0, 0).size (), vsize (0));
67 EQUAL (v
.slice (0, v
.size ()).size (), v
.size ());
68 EQUAL (v
.slice (1, 2).size (), vsize (1));
70 EQUAL (vector
<int> (v
.begin (), v
.begin ()).size (), vsize (0));
71 EQUAL (vector
<int> (v
.begin (), v
.end ()).size (), v
.size ());
72 EQUAL (vector
<int> (v
.begin () + 1, v
.begin () + 2).size (),
84 v
.sort (default_compare
);
86 //sort (v.begin (), v.end ());
87 vector_sort (v
, less
<int> ());
101 v
.insert (v
.begin (), 1);
105 v
.insert (2, v
.size ());
107 v
.insert (v
.end (), 2);
109 EQUAL (v
.back (), 2);
111 u
.insert (u
.begin (), v
.begin (), v
.end ());
112 EQUAL (u
.size (), v
.size ());
114 u
.insert (u
.end (), v
.begin (), v
.end ());
115 EQUAL (u
.size (), v
.size ());
122 Link_array
<int> u
, v
;
126 int a
[5] = { 0, 1, 2, 3, 4 };
138 EQUAL (u
.size (), vsize (5));
140 EQUAL (u
.size (), vsize (7));
155 EQUAL (u
.size (), vsize (5));
164 vector_sort (v
, less
<int> ());
166 EQUAL (v
.size (), vsize (2));
175 vsize i
= binary_search (v
, 1, less
<int> ());
176 EQUAL (i
, vsize (1));