50 template<
typename CONTAINER>
52 std::function<
void(
typename CONTAINER::value_type)> func) {
53 for (
auto it = container.begin(); it != container.end();) {
65 template<
typename CONTAINER>
67 std::function<
bool(
typename CONTAINER::value_type)> func) {
68 for (
auto it = container.begin(); it != container.end();) {
85 template<
class LIST,
class COMPARER>
87 const int n = L.size();
91 for (
const typename LIST::value_type& x : L) {
98 for (
typename LIST::value_type& x : L) {
110 template<
typename CONTAINER,
typename TYPE,
typename ITERATOR>
112 std::function<
bool(
const TYPE&)> includeElement) {
115 for (
const auto& e : container) {
116 nElements += includeElement(e) ? 1 : 0;
119 ITERATOR result = container.end();
125 for (ITERATOR it = container.begin(); result == container.end(); it++) {
126 if (includeElement(*it)) {
129 if (elemCounter == chosenElement) {
144 template<
typename CONTAINER,
typename TYPE,
typename ITERATOR>
146 std::function<
bool(
const TYPE&)> includeElement,
int size) {
150 for (ITERATOR it = container.begin(); it != container.end(); it++) {
157 ITERATOR result = container.end();
159 for (
auto it : other) {
160 if (includeElement(*it)) {
187 template<
typename CONTAINER,
typename TYPE,
typename ITERATOR>
190 ITERATOR result = container.begin();
191 int size = container.size();
197 for (
int i = 0; i < index; i++) {
202 if (!includeElement(*result)) {
204 result = chooseIteratorByFastTest<CONTAINER, TYPE, ITERATOR>(container,
207 result = chooseIteratorBySlowTest<CONTAINER, TYPE, ITERATOR>(container,
208 includeElement, size);
220 template<
typename CONTAINER,
typename TYPE>
222 CONTAINER& container,
223 std::function<
bool(
const TYPE&)> includeElement = [](
const TYPE&) {
return true; },
224 bool isFastTest =
true) {
225 return internal::chooseIteratorFrom<CONTAINER, TYPE, typename CONTAINER::iterator>(container,
226 includeElement, isFastTest);
230 template<
typename CONTAINER,
typename TYPE>
232 const CONTAINER& container,
233 std::function<
bool(
const TYPE&)> includeElement = [](
const TYPE&) {
return true; },
234 bool isFastTest =
true) {
235 return internal::chooseIteratorFrom<const CONTAINER, TYPE, typename CONTAINER::const_iterator>(
236 container, includeElement, isFastTest);