diff --git a/asio/include/asio/impl/connect.hpp b/asio/include/asio/impl/connect.hpp index 3ebe732b..9392f061 100644 --- a/asio/include/asio/impl/connect.hpp +++ b/asio/include/asio/impl/connect.hpp @@ -333,10 +333,18 @@ namespace detail void operator()(asio::error_code ec, int start = 0) { - typename EndpointSequence::const_iterator begin = endpoints_.begin(); - typename EndpointSequence::const_iterator iter = begin; + this->process(ec, start, + const_cast(endpoints_).begin(), + const_cast(endpoints_).end()); + } + + //private: + template + void process(asio::error_code ec, + int start, Iterator begin, Iterator end) + { + Iterator iter = begin; std::advance(iter, index_); - typename EndpointSequence::const_iterator end = endpoints_.end(); switch (start_ = start) { @@ -387,7 +395,6 @@ namespace detail } } - //private: basic_socket& socket_; EndpointSequence endpoints_; std::size_t index_;