rangeless::fn
rangeless::fn::operators Namespace Reference

Functions

template<typename Arg , typename F >
auto operator % (Arg &&arg, F &&fn) -> decltype(std::forward< F >(fn)(std::forward< Arg >(arg)))
 return std::forward<F>(fn)(std::forward<Arg>(arg)) More...
 
template<typename Arg , typename F >
auto operator %= (Arg &arg, F &&fn) -> decltype(void(std::forward< F >(fn)(std::move(arg))))
 arg = fn::to(Arg{})(std::forward<F>(fn)(std::move(arg))); More...
 
template<class Container1 , class Container2 >
auto operator<<= (Container1 &cont1, Container2 &&cont2) -> decltype(void(cont1.insert(cont1.end(), std::move(*cont2.begin()))))
 End-insert elements of cont2 into cont1 by-move. More...
 
template<class Container1 , class Container2 >
auto operator<<= (Container1 &cont1, const Container2 &cont2) -> decltype(void(cont1.insert(cont1.end(), *cont2.begin())))
 
template<class Container1 , class Gen >
void operator<<= (Container1 &cont1, impl::seq< Gen > seq)
 
template<class Container >
void operator<<= (Container &cont, typename Container::value_type el)
 

Function Documentation

◆ operator %()

template<typename Arg , typename F >
auto rangeless::fn::operators::operator % ( Arg &&  arg,
F &&  fn 
) -> decltype( std::forward<F>(fn)(std::forward<Arg>(arg)) )

return std::forward<F>(fn)(std::forward<Arg>(arg))

This is similar to Haskell's operator (&) :: a -> (a -> b) -> b |infix 1| or F#'s operator |>

Definition at line 4548 of file fn.hpp.

◆ operator %=()

template<typename Arg , typename F >
auto rangeless::fn::operators::operator %= ( Arg &  arg,
F &&  fn 
) -> decltype(void(std::forward<F>(fn)(std::move(arg))))

arg = fn::to(Arg{})(std::forward<F>(fn)(std::move(arg)));

strs %= fn::where([](const std::string& s){ return !s.empty(); }); // drop empty strings

Definition at line 4561 of file fn.hpp.

◆ operator<<=() [1/4]

template<class Container1 , class Container2 >
auto rangeless::fn::operators::operator<<= ( Container1 &  cont1,
Container2 &&  cont2 
) -> decltype(void(cont1.insert(cont1.end(), std::move(*cont2.begin()))))

End-insert elements of cont2 into cont1 by-move.

out <<= GetItems();
// equivalent of:
{{
auto items = GetItems();
for(auto&& item : items) {
out.insert(out.end(), std::move(item));
}
}}

Definition at line 4584 of file fn.hpp.

◆ operator<<=() [2/4]

template<class Container1 , class Container2 >
auto rangeless::fn::operators::operator<<= ( Container1 &  cont1,
const Container2 &  cont2 
) -> decltype(void(cont1.insert(cont1.end(), *cont2.begin())))

Definition at line 4600 of file fn.hpp.

◆ operator<<=() [3/4]

template<class Container1 , class Gen >
void rangeless::fn::operators::operator<<= ( Container1 &  cont1,
impl::seq< Gen >  seq 
)

Definition at line 4613 of file fn.hpp.

◆ operator<<=() [4/4]

template<class Container >
void rangeless::fn::operators::operator<<= ( Container &  cont,
typename Container::value_type  el 
)

Definition at line 4619 of file fn.hpp.