20 #include <ripple/beast/core/LexicalCast.h>
21 #include <ripple/beast/rfc2616.h>
22 #include <ripple/overlay/impl/ProtocolVersion.h>
23 #include <boost/function_output_iterator.hpp>
24 #include <boost/regex.hpp>
41 []() constexpr->bool {
42 auto const len = std::distance(
43 std::begin(supportedProtocolList), std::end(supportedProtocolList));
53 for (auto i = 0; i != len - 1; ++i)
55 if (supportedProtocolList[i] >= supportedProtocolList[i + 1])
62 "The list of supported protocols isn't properly sorted.");
78 static boost::regex re(
81 "([2-9]|(?:[1-9][0-9]+))"
88 boost::regex_constants::optimize);
102 if (boost::regex_match(s, m, re))
116 if (to_string(proto) == s)
128 boost::optional<ProtocolVersion>
131 boost::optional<ProtocolVersion> result;
146 boost::make_function_output_iterator(pickVersion));
151 boost::optional<ProtocolVersion>