On Tue, Jul 4, 2017 at 6:30 PM, Glen Fernandes via Boost
5. There are clamp() utilities defined in two places (ranges.hpp and clamp.hpp).
Maybe all of these can exist in one place.
There are 3 versions of clamp(), they are all slightly different, and there are no Boost equivalents. clamp.hpp is carefully designed to handle the case where Beast needs to limit the size of a buffer to either max std::size_t or some larger number that is represented as a 64-bit unsigned regardless of whether the 32-bit or 64-bit address model is being built. This ensures that 32-bit builds of Beast are capable of digesting information whose size is stored in a 64-bit unsigned. For example, a 32-bit build of Beast can still process a chunked message body that exceeds 2^32 bits in size. The other file helps sweep zlib's numerous integer conversion warnings under the rug without modifying the sources too much (so that I can compare the Beast version against the original more easily).