49 struct empty_transducer_error : std::runtime_error
51 using base_t = std::runtime_error;
53 empty_transducer_error() : base_t(
"empty transducer") {}
59 template <
typename RangeT>
60 auto check_non_empty(RangeT&& x) -> RangeT&&
64 if (begin(x) == end(x))
65 throw empty_transducer_error{};
66 return std::forward<RangeT>(x);
C++ amazing templates and reusable implementations awesomeness.