This file includes the definition of the following algorithms:
#include <rangelib/rangelib.hpp>
#include <rangelib/range_categories.hpp>
#include <rangelib/error/exceptions.hpp>
#include <rangelib/basic_indirect_range_adaptor.hpp>
#include <algorithm>
#include <numeric>
Go to the source code of this file.
Namespaces | |
namespace | rangelib |
Functions | |
template<typename R, typename T> | |
T | r_accumulate_2_impl (R r, T val, notional_range_tag const &) |
template<typename R, typename T> | |
T | r_accumulate_2_impl (R r, T val, iterable_range_tag const &) |
template<typename R, typename T> | |
T | r_accumulate_2_impl (R r, T val, basic_indirect_range_tag const &) |
template<typename R, typename T> | |
T | r_accumulate_2_impl (R r, T val, indirect_range_tag const &) |
template<typename R, typename T> | |
T | r_accumulate (R r, T val) |
accumulate() for ranges | |
template<typename R, typename T, typename P> | |
T | r_accumulate_3_impl (R r, T val, P pred, notional_range_tag const &) |
template<typename R, typename T, typename P> | |
T | r_accumulate_3_impl (R r, T val, P pred, iterable_range_tag const &) |
template<typename R, typename T, typename P> | |
T | r_accumulate_2_impl (R r, T val, P pred, basic_indirect_range_tag const &) |
template<typename R, typename T, typename P> | |
T | r_accumulate_3_impl (R r, T val, P pred, indirect_range_tag const &) |
template<typename R, typename T, typename P> | |
T | r_accumulate (R r, T val, P pred) |
accumulate() for ranges | |
template<typename R, typename O> | |
O | r_copy_impl (R r, O o, notional_range_tag const &) |
template<typename R, typename O> | |
O | r_copy_impl (R r, O o, iterable_range_tag const &) |
template<typename R, typename O> | |
O | r_copy_impl (R r, O o, indirect_range_tag const &) |
template<typename R, typename O> | |
O | r_copy_impl (R r, O o, basic_indirect_range_tag const &) |
template<typename R, typename O> | |
O | r_copy (R r, O o) |
Copies the contents of the range to the output iterator. | |
template<typename R, typename O, typename P> | |
O | r_copy_if_impl (R r, O o, P pred, notional_range_tag const &) |
template<typename R, typename O, typename P> | |
O | r_copy_if_impl (R r, O o, P pred, indirect_range_tag const &) |
template<typename R, typename O, typename P> | |
O | r_copy_if_impl (R r, O o, P pred, basic_indirect_range_tag const &) |
template<typename R, typename O, typename P> | |
O | r_copy_if (R r, O o, P pred) |
Copies the contents of the range to the output iterator. | |
template<typename R, typename T> | |
size_t | r_count_impl (R r, T const &val, notional_range_tag const &) |
template<typename R, typename T> | |
size_t | r_count_impl (R r, T const &val, iterable_range_tag const &) |
template<typename R, typename T> | |
size_t | r_count_impl (R r, T const &val, basic_indirect_range_tag const &) |
template<typename R, typename T> | |
size_t | r_count_impl (R r, T const &val, indirect_range_tag const &) |
template<typename R, typename T> | |
size_t | r_count (R r, T const &val) |
Counts the number of instances of a given value in the range. | |
template<typename R, typename P> | |
size_t | r_count_if_impl (R r, P pred, notional_range_tag const &) |
template<typename R, typename P> | |
size_t | r_count_if_impl (R r, P pred, iterable_range_tag const &) |
template<typename R, typename P> | |
size_t | r_count_if_impl (R r, P pred, basic_indirect_range_tag const &) |
template<typename R, typename P> | |
size_t | r_count_if_impl (R r, P pred, indirect_range_tag const &) |
template<typename R, typename P> | |
size_t | r_count_if (R r, P pred) |
Counts the number of instances matching the given predicate in the range. | |
template<typename R> | |
ss_ptrdiff_t | r_distance_1_impl (R r, notional_range_tag const &) |
template<typename R> | |
ss_ptrdiff_t | r_distance_1_impl (R r, iterable_range_tag const &) |
template<typename R> | |
ss_ptrdiff_t | r_distance_1_impl (R r, indirect_range_tag const &) |
template<typename R> | |
ss_ptrdiff_t | r_distance_1_impl (R r, basic_indirect_range_tag const &) |
template<typename R> | |
ss_ptrdiff_t | r_distance (R r) |
Counts the number of instances in the range. | |
template<typename R1, typename R2> | |
bool | r_equal_1_impl (R1 r1, R2 r2, notional_range_tag const &, notional_range_tag const &) |
template<typename R1, typename R2> | |
bool | r_equal_1_impl (R1 r1, R2 r2, iterable_range_tag const &, iterable_range_tag const &) |
template<typename R1, typename R2> | |
bool | r_equal (R1 r1, R2 r2) |
Determines whether two ranges are equal. | |
template<typename R1, typename R2, typename P> | |
bool | r_equal_1_impl (R1 r1, R2 r2, P pred, notional_range_tag const &, notional_range_tag const &) |
template<typename R1, typename R2, typename P> | |
bool | r_equal_1_impl (R1 r1, R2 r2, P pred, iterable_range_tag const &, iterable_range_tag const &) |
template<typename R1, typename R2, typename P> | |
bool | r_equal (R1 r1, R2 r2, P pred) |
Determines whether two ranges are equal, as defined by a predicate. | |
template<typename R, typename T> | |
bool | r_exists_impl (R r, T const &val, notional_range_tag const &) |
template<typename R, typename T> | |
bool | r_exists_impl (R r, T const &val, iterable_range_tag const &) |
template<typename R, typename T> | |
bool | r_exists_impl (R r, T const &val, basic_indirect_range_tag const &) |
template<typename R, typename T> | |
bool | r_exists_impl (R r, T const &val, indirect_range_tag const &) |
template<typename R, typename T> | |
bool | r_exists (R r, T const &val) |
Determines whether the given value exists in the range. | |
template<typename R, typename P> | |
bool | r_exists_if_1_impl (R r, P pred, notional_range_tag const &) |
template<typename R, typename P> | |
bool | r_exists_if_1_impl (R r, P pred, iterable_range_tag const &) |
template<typename R, typename P> | |
bool | r_exists_if_1_impl (R r, P pred, basic_indirect_range_tag const &) |
template<typename R, typename P> | |
bool | r_exists_if_1_impl (R r, P pred, indirect_range_tag const &) |
template<typename R, typename P> | |
bool | r_exists_if (R r, P pred) |
Determines whether a value matching the given predicate exists in the range. | |
template<typename R, typename P, typename T> | |
bool | r_exists_if_2_impl (R r, P pred, T &result, notional_range_tag const &) |
template<typename I, typename V> | |
bool | r_exists_if_2_impl_helper_ (I from, I to, V &val) |
template<typename R, typename P, typename T> | |
bool | r_exists_if_2_impl (R r, P pred, T &result, iterable_range_tag const &) |
template<typename R, typename P, typename T> | |
bool | r_exists_if_2_impl (R r, P pred, T &result, basic_indirect_range_tag const &) |
template<typename R, typename P, typename T> | |
bool | r_exists_if_2_impl (R r, P pred, T &result, indirect_range_tag const &) |
template<typename R, typename P, typename T> | |
R | r_exists_if (R r, P pred, T &result) |
Determines whether a value matching the given predicate exists in the range. | |
template<typename R, typename T> | |
void | r_fill_impl (R r, T const &val, iterable_range_tag const &) |
template<typename R, typename T> | |
void | r_fill (R r, T const &val) |
Sets the elements in the range to the given value. | |
template<typename R, typename S, typename T> | |
void | r_fill_n_impl (R r, S n, T const &val, iterable_range_tag const &) |
template<typename R, typename S, typename T> | |
void | r_fill_n (R r, S n, T const &val) |
Sets the first n elements in the range to the given value. | |
template<typename R, typename T> | |
R | r_find_impl (R r, T const &val, notional_range_tag const &) |
template<typename R, typename T> | |
R | r_find_impl (R r, T const &val, iterable_range_tag const &) |
template<typename R, typename T> | |
R | r_find (R r, T const &val) |
Finds the first instance of the given value in the range. | |
template<typename R, typename P> | |
R | r_find_if_impl (R r, P pred, notional_range_tag const &) |
template<typename R, typename P> | |
R | r_find_if_impl (R r, P pred, iterable_range_tag const &) |
template<typename R, typename P> | |
R | r_find_if (R r, P pred) |
Finds the first instance of a value in the range matching the given predicate. | |
template<typename R, typename F> | |
F | r_for_each_impl (R r, F f, notional_range_tag const &) |
template<typename R, typename F> | |
F | r_for_each_impl (R r, F f, iterable_range_tag const &) |
template<typename R, typename F> | |
F | r_for_each_impl (R r, F f, basic_indirect_range_tag const &) |
template<typename R, typename F> | |
F | r_for_each_impl (R r, F f, indirect_range_tag const &) |
template<typename R, typename F> | |
F | r_for_each (R r, F f) |
Applies the given function to every element in the range. | |
template<typename R, typename F> | |
void | r_generate_impl (R r, F f, iterable_range_tag const &) |
template<typename R, typename F> | |
void | r_generate (R r, F f) |
Sets each element in the range to the result of the given function. | |
template<typename R> | |
ss_typename_type_ret_k R::value_type | r_max_element_1_impl (R r, notional_range_tag const &) |
template<typename I> | |
I | r_max_element_1_impl_iterable (I from, I to) |
template<typename R> | |
ss_typename_type_ret_k R::value_type | r_max_element_1_impl (R r, iterable_range_tag const &) |
template<typename R> | |
ss_typename_type_ret_k R::value_type | r_max_element_1_impl (R r, basic_indirect_range_tag const &) |
template<typename R> | |
ss_typename_type_ret_k R::value_type | r_max_element_1_impl (R r, indirect_range_tag const &) |
template<typename R> | |
ss_typename_type_ret_k R::value_type | r_max_element (R r) |
Evaluates the maximum element in the range. | |
template<typename I, typename F> | |
I | r_max_element_2_impl_iterable (I from, I to, F f) |
template<typename R, typename F> | |
ss_typename_type_ret_k R::value_type | r_max_element_2_impl (R r, F f, iterable_range_tag const &) |
template<typename R, typename F> | |
ss_typename_type_ret_k R::value_type | r_max_element_2_impl (R r, F f, notional_range_tag const &) |
template<typename R, typename F> | |
ss_typename_type_ret_k R::value_type | r_max_element_2_impl (R r, F f, basic_indirect_range_tag const &) |
template<typename R, typename F> | |
ss_typename_type_ret_k R::value_type | r_max_element_2_impl (R r, F f, indirect_range_tag const &) |
template<typename R, typename F> | |
ss_typename_type_ret_k R::value_type | r_max_element (R r, F f) |
Evaluates the maximum element in the range evaluated according to the given function. | |
template<typename R> | |
ss_typename_type_ret_k R::value_type | r_min_element_1_impl (R r, notional_range_tag const &) |
template<typename I> | |
I | r_min_element_1_impl_iterable (I from, I to) |
template<typename R> | |
ss_typename_type_ret_k R::value_type | r_min_element_1_impl (R r, iterable_range_tag const &) |
template<typename R> | |
ss_typename_type_ret_k R::value_type | r_min_element_1_impl (R r, basic_indirect_range_tag const &) |
template<typename R> | |
ss_typename_type_ret_k R::value_type | r_min_element_1_impl (R r, indirect_range_tag const &) |
template<typename R> | |
ss_typename_type_ret_k R::value_type | r_min_element (R r) |
Evaluates the minimum element in the range. | |
template<typename I, typename F> | |
I | r_min_element_2_impl_iterable (I from, I to, F f) |
template<typename R, typename F> | |
ss_typename_type_ret_k R::value_type | r_min_element_2_impl (R r, F f, iterable_range_tag const &) |
template<typename R, typename F> | |
ss_typename_type_ret_k R::value_type | r_min_element_2_impl (R r, F f, notional_range_tag const &) |
template<typename R, typename F> | |
ss_typename_type_ret_k R::value_type | r_min_element_2_impl (R r, F f, basic_indirect_range_tag const &) |
template<typename R, typename F> | |
ss_typename_type_ret_k R::value_type | r_min_element_2_impl (R r, F f, indirect_range_tag const &) |
template<typename R, typename F> | |
ss_typename_type_ret_k R::value_type | r_min_element (R r, F f) |
Evaluates the minimum element in the range evaluated according to the given function. | |
template<typename R, typename T> | |
void | r_replace_impl (R r, T oldVal, T newVal, iterable_range_tag const &) |
template<typename R, typename T> | |
void | r_replace_impl (R r, T oldVal, T newVal, indirect_range_tag const &) |
template<typename R, typename T> | |
void | r_replace (R r, T oldVal, T newVal) |
Replaces all elements of the given old value with the new value. | |
template<typename R, typename P, typename T> | |
void | r_replace_if_impl (R r, P pred, T newVal, iterable_range_tag const &) |
template<typename R, typename P, typename T> | |
void | r_replace_if_impl (R r, P pred, T newVal, indirect_range_tag const &) |
template<typename R, typename P, typename T> | |
void | r_replace_if (R r, P pred, T newVal) |
Replaces all elements matching the given predicate with the new value. |