guess I got what I deserved for this sin -_-
https://codereview.stackexchange.com/questions/252686/whats-wrong-with-my-midpoint
unsigned short promotes to SIGNED int?! why... why did you do this to us C ?!
want!
Should 0 total duration be a valid state for a timer?
It's a sentinel value that might take care of some edge cases, but then have to guard against division by 0 when calculating progress ratio (elapsed/total). It's the only sensible default initialization value, but it also doesn't really makes sense conceptually - it's done/triggered before it's even started.
I wrote
container.push_back(item);
auto& new_item = container.front();
and suffered grave consequences.
From now on i will only write
auto& new_item = container.emplace_back(item);
Another even crazier "compile my unit test" challenge. This time must run as well.
std::visit should have been called transform and should have worked with tuples
std::reduce as it is now should have just been an std::accumulate overload (barring the default init, which is evil, and should be instead inferred from the operator when possible, through some standard interface)
a function called reduce should support partial reductions
my vector type is not properly vectorized by the compilers in non trivial programs... re