29 template<
typename LeftSig,
typename RightSig>
32 using Left_f = std::function<LeftSig>;
33 using Right_f = std::function<RightSig>;
51 template<
typename L,
typename R>
65 explicit operator bool ()
const
67 return Left_ && Right_;
83 template<
typename...
Args>
86 return Left_ (std::forward<Args> (
args)...);
102 template<
typename...
Args>
105 return Right_ (std::forward<Args> (
args)...);
A peir of two functions, typically a continuation and an error handler.
auto Right(Args &&... args) const
Invoke the right function and return its result.
auto Left(Args &&... args) const
Invoke the left function and return its result.
EitherCont()=default
Default-constructs the continuation with uninitialized functions.
EitherCont(const L &l, const R &r)
Sets the left and right functions to l and r.
Container< T > Filter(const Container< T > &c, F f)