MCPcopy Create free account
hub / github.com/Dobiasd/FunctionalPlus / errors

Function errors

include/fplus/filter.hpp:291–302  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

289 typename internal::same_cont_new_t<ContainerIn,
290 typename ContainerIn::value_type::error_t>::type>
291ContainerOut errors(const ContainerIn& xs)
292{
293 typedef typename ContainerIn::value_type::ok_t Ok;
294 typedef typename ContainerIn::value_type::error_t Error;
295 auto errorsInResults = keep_if(is_error<Ok, Error>, xs);
296 ContainerOut ys;
297 internal::prepare_container(ys, fplus::size_of_cont(errorsInResults));
298 auto itOut = internal::get_back_inserter(ys);
299 std::transform(std::begin(errorsInResults), std::end(errorsInResults),
300 itOut, unsafe_get_error<Ok, Error>);
301 return ys;
302}
303
304// API search type: trim_left : (a, [a]) -> [a]
305// fwd bind count: 1

Callers 2

filter_test.cppFile · 0.50
result_test.cppFile · 0.50

Calls 5

keep_ifFunction · 0.70
prepare_containerFunction · 0.70
size_of_contFunction · 0.70
get_back_inserterFunction · 0.70
transformFunction · 0.70

Tested by

no test coverage detected