Transformation algorithms.
Modules | |
lazy | |
Typedefs | |
template<typename L , typename State , typename Fn > | |
using | meta::accumulate = fold< L, State, Fn > |
An alias for meta::fold . More... | |
template<typename ListOfLists > | |
using | meta::cartesian_product = reverse_fold< ListOfLists, list< list<> >, quote_trait< detail::cartesian_product_fn > > |
Given a list of lists ListOfLists , return a new list of lists that is the Cartesian Product. Like the sequence function from the Haskell Prelude. More... | |
template<typename... Ls> | |
using | meta::concat_ = _t< detail::concat_< Ls... > > |
Concatenates several lists into a single list. More... | |
template<typename L , typename N > | |
using | meta::drop = drop_c< L, N::type::value > |
Return a new meta::list by removing the first N elements from L . More... | |
template<typename L , std::size_t N> | |
using | meta::drop_c = _t< detail::drop_< L, N > > |
Return a new meta::list by removing the first N elements from L . More... | |
template<typename L , typename Pred > | |
using | meta::filter = join< transform< L, detail::filter_< Pred > >> |
Returns a new meta::list where only those elements of L that satisfy the Callable Pred such that invoke<Pred,A>::value is true are present. That is, those elements that don't satisfy the Pred are "removed". More... | |
template<typename L , typename State , typename Fn > | |
using | meta::fold = _t< detail::fold_< L, id< State >, Fn > > |
Return a new meta::list constructed by doing a left fold of the list L using binary Invocable Fn and initial state State . That is, the State_N for the list element A_N is computed by Fn(State_N-1, A_N) -> State_N . More... | |
template<typename ListOfLists > | |
using | meta::join = apply< quote< concat >, ListOfLists > |
Joins a list of lists into a single list. More... | |
template<typename L , typename Fn > | |
using | meta::partition = fold< L, pair< list<>, list<> >, detail::partition_< Fn > > |
Returns a pair of lists, where the elements of L that satisfy the Invocable Fn such that invoke<Fn,A>::value is true are present in the first list and the rest are in the second. More... | |
template<typename L > | |
using | meta::pop_front = _t< detail::pop_front_< L > > |
Return a new meta::list by removing the first element from the front of L . More... | |
template<typename L , typename... Ts> | |
using | meta::push_back = apply< bind_back< quote< list >, Ts... >, L > |
Return a new meta::list by adding the element T to the back of L . More... | |
template<typename L , typename... Ts> | |
using | meta::push_front = apply< bind_front< quote< list >, Ts... >, L > |
Return a new meta::list by adding the element T to the front of L . More... | |
template<typename L , typename T , typename U > | |
using | meta::replace = _t< detail::replace_< L, T, U > > |
Return a new meta::list where all instances of type T have been replaced with U . More... | |
template<typename L , typename C , typename U > | |
using | meta::replace_if = _t< detail::replace_if_< L, C, U > > |
Return a new meta::list where all elements A of the list L for which invoke<C,A>::value is true have been replaced with U . More... | |
template<typename L > | |
using | meta::reverse = _t< detail::reverse_< L > > |
Return a new meta::list by reversing the elements in the list L . More... | |
template<typename L , typename State , typename Fn > | |
using | meta::reverse_fold = _t< detail::reverse_fold_< L, State, Fn > > |
Return a new meta::list constructed by doing a right fold of the list L using binary Invocable Fn and initial state State . That is, the State_N for the list element A_N is computed by Fn(A_N, State_N+1) -> State_N . More... | |
template<typename L , typename Fn > | |
using | meta::sort = _t< detail::sort_< L, Fn > > |
Return a new meta::list that is sorted according to Invocable predicate Fn . More... | |
template<typename... Args> | |
using | meta::transform = _t< detail::transform_< list< Args... > >> |
Return a new meta::list constructed by transforming all the elements in L with the unary Invocable Fn . transform can also be called with two lists of the same length and a binary Invocable, in which case it returns a new list constructed with the results of calling Fn with each element in the lists, pairwise. More... | |
template<typename ListOfLists > | |
using | meta::transpose = fold< ListOfLists, repeat_n< size< front< ListOfLists > >, list<> >, bind_back< quote< transform >, quote< push_back > >> |
Given a list of lists of types ListOfLists , transpose the elements from the lists. More... | |
template<typename L > | |
using | meta::unique = fold< L, list<>, quote_trait< detail::insert_back_ > > |
Return a new meta::list where all duplicate elements have been removed. More... | |
template<typename ListOfLists > | |
using | meta::zip = transpose< ListOfLists > |
Given a list of lists of types ListOfLists , construct a new list by grouping the elements from the lists pairwise into meta::list s. More... | |
template<typename Fn , typename ListOfLists > | |
using | meta::zip_with = transform< transpose< ListOfLists >, uncurry< Fn > > |
Given a list of lists of types ListOfLists and an Invocable Fn , construct a new list by calling Fn with the elements from the lists pairwise. More... | |
using meta::accumulate = typedef fold<L, State, Fn> |
using meta::cartesian_product = typedef reverse_fold<ListOfLists, list<list<> >, quote_trait<detail::cartesian_product_fn> > |
#include <meta/meta.hpp>
Given a list of lists ListOfLists
, return a new list of lists that is the Cartesian Product. Like the sequence
function from the Haskell Prelude.
using meta::concat_ = typedef _t<detail::concat_<Ls...> > |
#include <meta/meta.hpp>
Concatenates several lists into a single list.
meta::list
.
|
related |
#include <meta/meta.hpp>
Return a new meta::list
by removing the first N
elements from L
.
using meta::drop_c = typedef _t<detail::drop_<L, N> > |
#include <meta/meta.hpp>
Return a new meta::list
by removing the first N
elements from L
.
using meta::filter = typedef join<transform<L, detail::filter_<Pred> >> |
#include <meta/meta.hpp>
Returns a new meta::list where only those elements of L
that satisfy the Callable Pred
such that invoke<Pred,A>::value
is true
are present. That is, those elements that don't satisfy the Pred
are "removed".
using meta::fold = typedef _t<detail::fold_<L, id<State>, Fn> > |
#include <meta/meta.hpp>
Return a new meta::list
constructed by doing a left fold of the list L
using binary Invocable Fn
and initial state State
. That is, the State_N
for the list element A_N
is computed by Fn(State_N-1, A_N) -> State_N
.
|
related |
#include <meta/meta.hpp>
Joins a list of lists into a single list.
meta::list<T
...> where each T
is itself an instantiation of meta::list
. using meta::partition = typedef fold<L, pair<list<>, list<> >, detail::partition_<Fn> > |
#include <meta/meta.hpp>
Returns a pair of lists, where the elements of L
that satisfy the Invocable Fn
such that invoke<Fn,A>::value
is true
are present in the first list and the rest are in the second.
using meta::pop_front = typedef _t<detail::pop_front_<L> > |
#include <meta/meta.hpp>
Return a new meta::list
by removing the first element from the front of L
.
using meta::push_back = typedef apply<bind_back<quote<list>, Ts...>, L> |
#include <meta/meta.hpp>
Return a new meta::list
by adding the element T
to the back of L
.
pop_back
not provided because it cannot be made to meet the complexity guarantees one would expect. using meta::push_front = typedef apply<bind_front<quote<list>, Ts...>, L> |
#include <meta/meta.hpp>
Return a new meta::list
by adding the element T
to the front of L
.
|
related |
#include <meta/meta.hpp>
Return a new meta::list
where all instances of type T
have been replaced with U
.
|
related |
#include <meta/meta.hpp>
Return a new meta::list
where all elements A
of the list L
for which invoke<C,A>::value
is true
have been replaced with U
.
|
related |
#include <meta/meta.hpp>
Return a new meta::list
by reversing the elements in the list L
.
using meta::reverse_fold = typedef _t<detail::reverse_fold_<L, State, Fn> > |
#include <meta/meta.hpp>
Return a new meta::list
constructed by doing a right fold of the list L
using binary Invocable Fn
and initial state State
. That is, the State_N
for the list element A_N
is computed by Fn(A_N, State_N+1) -> State_N
.
|
related |
#include <meta/meta.hpp>
Return a new meta::list
that is sorted according to Invocable predicate Fn
.
|
related |
#include <meta/meta.hpp>
Return a new meta::list
constructed by transforming all the elements in L
with the unary Invocable Fn
. transform
can also be called with two lists of the same length and a binary Invocable, in which case it returns a new list constructed with the results of calling Fn
with each element in the lists, pairwise.
using meta::transpose = typedef fold<ListOfLists, repeat_n<size<front<ListOfLists> >, list<> >, bind_back<quote<transform>, quote<push_back> >> |
#include <meta/meta.hpp>
Given a list of lists of types ListOfLists
, transpose the elements from the lists.
|
related |
#include <meta/meta.hpp>
Return a new meta::list
where all duplicate elements have been removed.
#include <meta/meta.hpp>
Given a list of lists of types ListOfLists
, construct a new list by grouping the elements from the lists pairwise into meta::list
s.
|
related |
#include <meta/meta.hpp>
Given a list of lists of types ListOfLists
and an Invocable Fn
, construct a new list by calling Fn
with the elements from the lists pairwise.