MCPcopy Create free account
hub / github.com/CppCXY/EmmyLuaCodeStyle / partial_search

Function partial_search

3rd/asio-1.24.0/include/asio/impl/read_until.hpp:49–72  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

47 // (last1,false) if no full or partial match was found.
48 template <typename Iterator1, typename Iterator2>
49 std::pair<Iterator1, bool> partial_search(
50 Iterator1 first1, Iterator1 last1, Iterator2 first2, Iterator2 last2)
51 {
52 for (Iterator1 iter1 = first1; iter1 != last1; ++iter1)
53 {
54 Iterator1 test_iter1 = iter1;
55 Iterator2 test_iter2 = first2;
56 for (;; ++test_iter1, ++test_iter2)
57 {
58 if (test_iter2 == last2)
59 return std::make_pair(iter1, true);
60 if (test_iter1 == last1)
61 {
62 if (test_iter2 != first2)
63 return std::make_pair(iter1, false);
64 else
65 break;
66 }
67 if (*test_iter1 != *test_iter2)
68 break;
69 }
70 }
71 return std::make_pair(last1, false);
72 }
73} // namespace detail
74
75#if !defined(ASIO_NO_DYNAMIC_BUFFER_V1)

Callers 3

read_untilFunction · 0.85
operator()Method · 0.85
operator()Method · 0.85

Calls 1

make_pairFunction · 0.85

Tested by

no test coverage detected