10 #ifndef BOOST_BEAST_DETAIL_VARINT_HPP 11 #define BOOST_BEAST_DETAIL_VARINT_HPP 13 #include <boost/static_assert.hpp> 16 #include <type_traits> 41 using value_type =
typename 42 std::iterator_traits<FwdIt>::value_type;
44 std::is_integral<value_type>::value &&
45 sizeof(value_type) == 1);
46 std::size_t value = 0;
47 std::size_t factor = 1;
48 while((*first & 0x80) != 0)
50 value += (*first++ & 0x7f) * factor;
53 value += *first++ * factor;
61 using value_type =
typename 62 std::iterator_traits<FwdIt>::value_type;
64 std::is_integral<value_type>::value &&
65 sizeof(value_type) == 1);
68 *first++ =
static_cast<value_type
>(
72 *first++ =
static_cast<value_type
>(value);
Definition: async_result.hpp:20
std::size_t varint_read(FwdIt &first)
Definition: varint.hpp:39
std::size_t varint_size(std::size_t value)
Definition: varint.hpp:26
void varint_write(FwdIt &first, std::size_t value)
Definition: varint.hpp:59