示例#1
0
static UrlVector localhost_only(const UrlVector& input)
{
  UrlVector result;
  result.reserve(input.size());
  for (const auto& url: input)
  {
    if (isLocalHost(url.host()))
      result.push_back(url);
  }
  return result;
}
static UrlVector localhost_only(const UrlVector& input)
{
  UrlVector result;

  result.reserve(input.size());
  for (UrlVector::const_iterator it = input.begin(), end = input.end(); it != end; ++it)
  {
    const std::string& host = it->host();
    if (boost::algorithm::starts_with(host, "127.") || host == "localhost")
      result.push_back(*it);
  }
  return result;
}