message: reactor.resolve: clean up
  put private symbols in unnamed namespace
  prefer elle::fprintf to <<
diff: +#include <elle/reactor/network/resolve.hh>
  +
  +#include <utility>
  +
  #include <elle/log.hh>
  +#include <elle/printf.hh>
  #include <elle/reactor/network/exception.hh>
  -#include <elle/reactor/network/resolve.hh>
  #include <elle/reactor/Operation.hh>
  #include <elle/reactor/scheduler.hh>
  -#include <utility>
  ELLE_LOG_COMPONENT("elle.reactor.network.resolve");
  @@ -13,37 +16,32 @@ namespace elle
  namespace reactor
  {
  namespace network
  + {
  + namespace
  {
  template <typename Protocol>
  class Resolution: public Operation
  {
  public:
  + using Super = Operation;
  using Resolver = typename Protocol::resolver;
  using EndPoint = typename Protocol::resolver::endpoint_type;
  Resolution(std::string hostname, std::string service,
  - bool ipv4_only):
  - Operation(*reactor::Scheduler::scheduler()),
  - _resolver(reactor::Scheduler::scheduler()->io_service()),
  - _canceled(false),
  - _hostname(std::move(hostname)),
  - _service(std::move(service)),
  - _end_point(),
  - _ipv4_only(ipv4_only)
  + bool ipv4_only)
  + : Super{*reactor::Scheduler::scheduler()}
  + , _resolver{reactor::Scheduler::scheduler()->io_service()}
  + , _canceled{false}
  + , _hostname{std::move(hostname)}
  + , _service{std::move(service)}
  + , _end_point{}
  + , _ipv4_only{ipv4_only}
  {}
  void
  print(std::ostream& stream) const override
  {
  - stream << "resolution of " << this->_hostname << ":" << this->_service;
  - }
  -
  - virtual
  - const
  - char*
  - type_name() const
  - {
  - static const char* name = "name resolution";
  - return name;
  + elle::fprintf(stream,
  + "resolution of %s: %s", this->_hostname, this->_service);
  }
  protected:
  @@ -60,28 +58,24 @@ namespace elle
  _start() override
  {
  ELLE_TRACE("resolve %s:%s", this->_hostname, this->_service);
  - if (this->ipv4_only())
  - {
  - typename Resolver::query query(
  - Protocol::v4(),this->_hostname, this->_service);
  + using Query = typename Resolver::query;
  + auto query =
  + this->ipv4_only()
  + ? Query(Protocol::v4(), this->_hostname, this->_service)
  + : Query(this->_hostname, this->_service);
  this->_resolver.async_resolve(
  query,
  - boost::bind(&Resolution::_wakeup, this, _1, _2));
  - }
  - else
  + [this](const boost::system::error_code& error,
  + typename Resolver::iterator it)
  {
  - typename Resolver::query query(this->_hostname, this->_service);
  - this->_resolver.async_resolve(
  - query,
  - boost::bind(&Resolution::_wakeup, this, _1, _2));
  - }
  + this->_wakeup(error, it);
  + });
  }
  private:
  void
  _wakeup(const boost::system::error_code& error,
  typename Resolver::iterator it)
  -
  {
  if (this->_canceled)
  ELLE_TRACE_SCOPE("%s: canceled", *this);
  @@ -129,6 +123,7 @@ namespace elle
  resolution.run();
  return resolution.end_point();
  }
  + }
  boost::asio::ip::tcp::endpoint
  resolve_tcp(const std::string& hostname,
  