MT Core (C++)
Core library for replacing C++ standard in project usage
Loading...
Searching...
No Matches
mtcore::results Namespace Reference

Additional algorithms and pipeline functionality that can be performed on groups of results. More...

Functions

template<typename Success, typename Acc, typename F, Iterable I, typename Err = typename decltype(std::declval<F>()( std::declval<std::remove_const_t<typename decltype(std::declval<I>().iter())::IterElem>>()))::Err>
Result< Success, Err > accumulate (Success initial, const Acc &acc, const F &func, const I &iterable)
 Chains together the execution of an errorable function on a list of arguments If an error is encountered, execution will stop and immediately return No Result value is returned Useful for performing side effects.
 
template<typename F, Iterable I, typename Err = typename decltype(std::declval<F>()( std::declval<std::remove_const_t<typename decltype(std::declval<I>().iter())::IterElem>>()))::Err>
Result< void, Err > foreach (const F &func, const I &iterable)
 Chains together the execution of an errorable function on a list of arguments If an error is encountered, execution will stop and immediately return No Result value is returned Useful for performing side effects.
 
template<typename F, typename... Args, typename Err = typename decltype(std::declval<F>()(std::declval<typename impl::FirstVariadic<Args...>::Type>()))::Err>
Result< void, Err > chain (const F &func, const Args &...args)
 Chains together the execution of an errorable function on a list of arguments If an error is encountered, execution will stop and immediately return No Result value is returned Useful for performing side effects.
 
template<typename Success, typename Acc, typename F, typename... Args, typename Err = typename decltype(std::declval<F>()(std::declval<typename impl::FirstVariadic<Args...>::Type>()))::Err>
Result< Success, Err > reduce (Success initVal, const Acc &acc, const F &func, const Args &...args)
 Reduces arguments with errorable function If an error is encountered, execution will stop and immediately return The accumulated Result will be what's returned on success Useful for reduction/mapping.
 
template<typename F, typename... Args, typename Out = typename decltype(std::declval<F>()(std::declval<typename impl::FirstVariadic<Args...>::Type>()))::Value, typename Err = typename decltype(std::declval<F>()(std::declval<typename impl::FirstVariadic<Args...>::Type>()))::Err>
auto map (const F &func, const Args &...args)
 Maps values with function that may error.
 

Detailed Description

Additional algorithms and pipeline functionality that can be performed on groups of results.