38template <
class charT,
class Traits,
class T,
class Allocator>
40 const std::vector<T, Allocator> &
v)
42 std::copy (
v.begin (),
v.end (),
43 std::ostream_iterator<T, charT, Traits> (
strm,
" "));
51 typedef std::vector<int, std::allocator<int> >
Vector;
53 const Vector::value_type
d1[] = { 1, 2, 3, 4 };
54 const Vector::value_type
d2[] = { 1, 3, 2, 4 };
61 std::make_heap (
v1.begin (),
v1.end ());
62 std::make_heap (
v2.begin (),
v2.end (), std::less<int>());
76 std::pop_heap (
v1.begin (),
v1.end ());
77 std::pop_heap (
v2.begin (),
v2.end (), std::less<int>());
83 std::push_heap (
v1.begin (),
v1.end ());
84 std::push_heap (
v2.begin (),
v2.end (), std::less<int>());
90 std::sort_heap (
v1.begin (),
v1.end ());
91 std::sort_heap (
v2.begin (),
v2.end (), std::less<int>());
std::vector< UserClass, std::allocator< UserClass > > Vector
void print_vector(std::basic_ostream< charT, Traits > &strm, const std::vector< T, Allocator > &v)