asio-tr2 icon indicating copy to clipboard operation
asio-tr2 copied to clipboard

Consider adding a separate algorithm for saturating_increment

Open chriskohlhoff opened this issue 10 years ago • 2 comments

chriskohlhoff avatar Feb 25 '15 10:02 chriskohlhoff

I.e. the increment used in places like this:

size_t n = 0;
while (run_one())
  if (n != numeric_limits<size_t>::max())
    ++n;

chriskohlhoff avatar Apr 12 '15 04:04 chriskohlhoff

Pre-Lenexa Summary

[io_service.io_service]

Several effects clauses contain code like this:

if (n != numeric_limits<size_t>::max())
  ++n;

The suggestion was that we include an algorithm for this as part of the proposal.

Alternatively, we could simplify the specification by specifying SATURATING_INCREMENT (i.e. something like DECAY_COPY). Or we could just leave it as-is.

chriskohlhoff avatar May 05 '15 11:05 chriskohlhoff