23 template<
typename Container1,
typename Container2>
24 void copy(
const Container1& in, Container2& out)
26 assert(in.size() == out.size());
29 std::copy(begin(in), end(in), begin(out));
32 template<
typename Container,
typename Value>
33 void fill(Container& container,
const Value& value)
37 std::fill(begin(container), end(container), value);
40 template<
typename Container>
41 typename Container::iterator min_element(Container& container)
45 return std::min_element(begin(container), end(container));
48 template<
typename Container>
49 typename Container::const_iterator min_element(
const Container& container)
53 return std::min_element(begin(container), end(container));
56 template<
typename Container,
typename Compare>
57 typename Container::iterator min_element(Container& container, Compare comp)
61 return std::min_element(begin(container), end(container), comp);
64 template<
typename Container,
typename Compare>
65 typename Container::const_iterator min_element(
const Container& container, Compare comp)
69 return std::min_element(begin(container), end(container), comp);
72 template<
typename Container>
73 typename Container::iterator max_element(Container& container)
77 return std::max_element(begin(container), end(container));
80 template<
typename Container>
81 typename Container::const_iterator max_element(
const Container& container)
85 return std::max_element(begin(container), end(container));
89 template<
typename Container,
typename Compare>
90 typename Container::iterator max_element(Container& container, Compare comp)
94 return std::max_element(begin(container), end(container), comp);
97 template<
typename Container,
typename Compare>
98 typename Container::const_iterator max_element(
const Container& container, Compare comp)
102 return std::max_element(begin(container), end(container), comp);
105 template<
typename Container>
106 std::pair<const_iterator<Container>, const_iterator<Container>>
107 minmax_element(
const Container& container)
111 return std::minmax_element(begin(container), end(container));
114 template<
typename Container>
115 std::pair<iterator<Container>, iterator<Container>>
116 minmax_element(Container& container)
120 return std::minmax_element(begin(container), end(container));
123 template<
typename Container,
typename Compare>
124 std::pair<const_iterator<Container>, const_iterator<Container>>
125 minmax_element(
const Container& container, Compare comp)
129 return std::minmax_element(begin(container), end(container), comp);
132 template<
typename Container,
typename Compare>
133 std::pair<iterator<Container>, iterator<Container>>
134 minmax_element(Container& container, Compare comp)
138 return std::minmax_element(begin(container), end(container), comp);