Range-v3
Range algorithms, views, and actions for the Standard Library
Query/Search

Description

Query and search algorithms.

Modules

 lazy
 

Typedefs

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

Typedef Documentation

◆ all_of

template<typename List , typename F >
using meta::all_of = typedef empty<find_if<List, not_fn<F> >>

#include <meta/meta.hpp>

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

Complexity
$ O(N) $.

◆ any_of

template<typename List , typename F >
using meta::any_of = typedef not_<empty<find_if<List, F> >>

#include <meta/meta.hpp>

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

Complexity
$ O(N) $.

◆ count

template<typename List , typename T >
using meta::count = typedef _t<detail::count_<List, T> >

#include <meta/meta.hpp>

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

Complexity
$ O(N) $.

◆ count_if

template<typename List , typename Fn >
using meta::count_if = typedef _t<detail::count_if_<List, Fn> >

#include <meta/meta.hpp>

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

Complexity
$ O(N) $.

◆ find

template<typename List , typename T >
using meta::find = typedef drop<List, min<find_index<List, T>, size<List> >>

#include <meta/meta.hpp>

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

Complexity
$ O(N) $.

◆ find_if

template<typename List , typename Fun >
using meta::find_if = typedef _t<detail::find_if_<List, Fun> >

#include <meta/meta.hpp>

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

Complexity
$ O(N) $.

◆ find_index

template<typename List , typename T >
using meta::find_index = typedef _t<detail::find_index_<List, T> >

#include <meta/meta.hpp>

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

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

◆ in

template<typename List , typename T >
using meta::in = typedef not_<empty<find<List, T> >>

#include <meta/meta.hpp>

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

Complexity
$ O(N) $.

◆ none_of

template<typename List , typename F >
using meta::none_of = typedef empty<find_if<List, F> >

#include <meta/meta.hpp>

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

Complexity
$ O(N) $.

◆ reverse_find

template<typename List , typename T >
using meta::reverse_find = typedef drop<List, min<reverse_find_index<List, T>, size<List> >>

#include <meta/meta.hpp>

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

Complexity
$ O(N) $.

◆ reverse_find_if

template<typename List , typename Fun >
using meta::reverse_find_if = typedef _t<detail::reverse_find_if_<List, Fun> >

#include <meta/meta.hpp>

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

Complexity
$ O(N) $.

◆ reverse_find_index

template<typename List , typename T >
using meta::reverse_find_index = typedef _t<detail::reverse_find_index_<List, T> >

#include <meta/meta.hpp>

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

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