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

Function parse_content

test/udemy_course_test.cpp:384–391  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

382}
383
384result<Ints, string> parse_content(const string& content)
385{
386 const auto maybe_values = fwd::apply(content, fwd::split(',', false), fwd::transform(read_value<int>));
387 if (all_by(is_just<int>, maybe_values))
388 return ok<Ints, string>(justs(maybe_values));
389 else
390 return error<Ints, string>("Can not parse file.");
391}
392
393result<int, string> calc_median(const vector<int>& xs)
394{

Callers

nothing calls this directly

Calls 5

applyFunction · 0.50
splitFunction · 0.50
transformFunction · 0.50
all_byFunction · 0.50
justsFunction · 0.50

Tested by

no test coverage detected