Lines Matching refs:first

114 std::string percent_decode(InputIt first, InputIt last) {
116 result.resize(last - first);
118 for (; first != last; ++first) {
119 if (*first != '%') {
120 *p++ = *first;
124 if (first + 1 != last && first + 2 != last && is_hex_digit(*(first + 1)) &&
125 is_hex_digit(*(first + 2))) {
126 *p++ = (hex_to_uint(*(first + 1)) << 4) + hex_to_uint(*(first + 2));
127 first += 2;
131 *p++ = *first;
144 for (auto first = std::begin(target); first != std::end(target); ++first) {
145 uint8_t c = *first;
414 template <typename InputIt> void inp_strlower(InputIt first, InputIt last) {
415 std::transform(first, last, first, lowcase);
788 StringRef make_hostport(OutputIt first, const StringRef &host, uint16_t port) {
791 auto p = first;
809 return StringRef{first, p};
819 StringRef make_http_hostport(OutputIt first, const StringRef &host,
822 return make_hostport(first, host, port);
826 auto p = first;
840 return StringRef{first, p};
872 // Fills random alpha and digit byte to the range [|first|, |last|).
875 OutputIt random_alpha_digit(OutputIt first, OutputIt last, Generator &gen) {
881 for (; first != last; ++first) {
882 *first = s[dis(gen)];
884 return first;
887 // Fills random bytes to the range [|first|, |last|).
889 void random_bytes(OutputIt first, OutputIt last, Generator &gen) {
891 std::generate(first, last, [&dis, &gen]() { return dis(gen); });
894 // Shuffles the range [|first|, |last|] by calling swap function |fun|
898 void shuffle(RandomIt first, RandomIt last, Generator &&gen, SwapFun fun) {
899 auto len = std::distance(first, last);
910 fun(first + i, first + j);