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

Function errors

include_all_in_one/include/fplus/fplus.hpp:6023–6034  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

6021 typename internal::same_cont_new_t<ContainerIn,
6022 typename ContainerIn::value_type::error_t>::type>
6023ContainerOut errors(const ContainerIn& xs)
6024{
6025 typedef typename ContainerIn::value_type::ok_t Ok;
6026 typedef typename ContainerIn::value_type::error_t Error;
6027 auto errorsInResults = keep_if(is_error<Ok, Error>, xs);
6028 ContainerOut ys;
6029 internal::prepare_container(ys, fplus::size_of_cont(errorsInResults));
6030 auto itOut = internal::get_back_inserter(ys);
6031 std::transform(std::begin(errorsInResults), std::end(errorsInResults),
6032 itOut, unsafe_get_error<Ok, Error>);
6033 return ys;
6034}
6035
6036// API search type: trim_left : (a, [a]) -> [a]
6037// fwd bind count: 1

Callers

nothing calls this directly

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