Range-v3
Range algorithms, views, and actions for the Standard Library
 
Loading...
Searching...
No Matches
Query/Search

Query and search algorithms More...

Topics

 lazy
 
 

Typedefs

template<list_like L, invocable Fn>
using meta::all_of = empty<find_if<L, not_fn<Fn>>>
 A Boolean integral constant wrapper around true if invoke<Fn, A>::value is true for all elements A in meta::list L; false, otherwise.
 
template<list_like L, invocable Fn>
using meta::any_of = not_<empty<find_if<L, Fn>>>
 A Boolean integral constant wrapper around true if invoke<Fn, A>::value is true for any element A in meta::list L; false, otherwise.
 
template<list_like L, typename T >
using meta::count = _t<detail::count_<L, T>>
 Count the number of times a type T appears in the list L.
 
template<list_like L, invocable Fn>
using meta::count_if = _t<detail::count_if_<L, Fn>>
 Count the number of times the predicate Fn evaluates to true for all the elements in the list L.
 
template<list_like L, typename T >
using meta::find = drop<L, min<find_index<L, T>, size<L>>>
 Return the tail of the list L starting at the first occurrence of T, if any such element exists; the empty list, otherwise.
 
template<list_like L, invocable Fn>
using meta::find_if = _t<detail::find_if_<L, Fn>>
 Return the tail of the list L starting at the first element A such that invoke<Fn, A>::value is true, if any such element exists; the empty list, otherwise.
 
template<list_like L, typename T >
using meta::find_index = _t<detail::find_index_<L, T>>
 Finds the index of the first occurrence of the type T within the list L. Returns #meta::npos if the type T was not found.
 
template<list_like L, typename T >
using meta::in = not_<empty<find<L, T>>>
 A Boolean integral constant wrapper around true if there is at least one occurrence of T in L.
 
template<list_like L, invocable Fn>
using meta::none_of = empty<find_if<L, Fn>>
 A Boolean integral constant wrapper around true if invoke<Fn, A>::value is false for all elements A in meta::list L; false, otherwise.
 
template<list_like L, typename T >
using meta::reverse_find = drop<L, min<reverse_find_index<L, T>, size<L>>>
 Return the tail of the list L starting at the last occurrence of T, if any such element exists; the empty list, otherwise.
 
template<list_like L, invocable Fn>
using meta::reverse_find_if = _t<detail::reverse_find_if_<L, Fn>>
 Return the tail of the list L starting at the last element A such that invoke<Fn, A>::value is true, if any such element exists; the empty list, otherwise.
 
template<list_like L, typename T >
using meta::reverse_find_index = _t<detail::reverse_find_index_<L, T>>
 Finds the index of the last occurrence of the type T within the list L. Returns #meta::npos if the type T was not found.
 

Detailed Description

Query and search algorithms

Typedef Documentation

◆ all_of

template<list_like L, invocable Fn>
using meta::all_of = empty<find_if<L, not_fn<Fn>>>

#include <meta/meta.hpp>

A Boolean integral constant wrapper around true if invoke<Fn, A>::value is true for all elements A in meta::list L; false, otherwise.

Complexity
O(N).

◆ any_of

template<list_like L, invocable Fn>
using meta::any_of = not_<empty<find_if<L, Fn>>>

#include <meta/meta.hpp>

A Boolean integral constant wrapper around true if invoke<Fn, A>::value is true for any element A in meta::list L; false, otherwise.

Complexity
O(N).

◆ count

template<list_like L, typename T >
using meta::count = _t<detail::count_<L, T>>

#include <meta/meta.hpp>

Count the number of times a type T appears in the list L.

Complexity
O(N).

◆ count_if

template<list_like L, invocable Fn>
using meta::count_if = _t<detail::count_if_<L, Fn>>

#include <meta/meta.hpp>

Count the number of times the predicate Fn evaluates to true for all the elements in the list L.

Complexity
O(N).

◆ find

template<list_like L, typename T >
using meta::find = drop<L, min<find_index<L, T>, size<L>>>

#include <meta/meta.hpp>

Return the tail of the list L starting at the first occurrence of T, if any such element exists; the empty list, otherwise.

Complexity
O(N).

◆ find_if

template<list_like L, invocable Fn>
using meta::find_if = _t<detail::find_if_<L, Fn>>

#include <meta/meta.hpp>

Return the tail of the list L starting at the first element A such that invoke<Fn, A>::value is true, if any such element exists; the empty list, otherwise.

Complexity
O(N).

◆ find_index

template<list_like L, typename T >
using meta::find_index = _t<detail::find_index_<L, T>>

#include <meta/meta.hpp>

Finds the index of the first occurrence of the type T within the list L. Returns #meta::npos if the type T was not found.

Complexity
O(N).
See also
meta::npos

◆ in

template<list_like L, typename T >
using meta::in = not_<empty<find<L, T>>>

#include <meta/meta.hpp>

A Boolean integral constant wrapper around true if there is at least one occurrence of T in L.

Complexity
O(N).

◆ none_of

template<list_like L, invocable Fn>
using meta::none_of = empty<find_if<L, Fn>>

#include <meta/meta.hpp>

A Boolean integral constant wrapper around true if invoke<Fn, A>::value is false for all elements A in meta::list L; false, otherwise.

Complexity
O(N).

◆ reverse_find

template<list_like L, typename T >
using meta::reverse_find = drop<L, min<reverse_find_index<L, T>, size<L>>>

#include <meta/meta.hpp>

Return the tail of the list L starting at the last occurrence of T, if any such element exists; the empty list, otherwise.

Complexity
O(N).

◆ reverse_find_if

template<list_like L, invocable Fn>
using meta::reverse_find_if = _t<detail::reverse_find_if_<L, Fn>>

#include <meta/meta.hpp>

Return the tail of the list L starting at the last element A such that invoke<Fn, A>::value is true, if any such element exists; the empty list, otherwise.

Complexity
O(N).

◆ reverse_find_index

template<list_like L, typename T >
using meta::reverse_find_index = _t<detail::reverse_find_index_<L, T>>

#include <meta/meta.hpp>

Finds the index of the last occurrence of the type T within the list L. Returns #meta::npos if the type T was not found.

Complexity
O(N).
See also
#meta::npos