asio tutorial question on
I am going through the tutorial on asio at http://www.boost.org/doc/libs/1_37_0/doc/html/boost_asio/tutorial/tutdaytime... and so far so good. I have a question, the end iterator doesn't seem to be assigned a value, in the examples. I was wondering how does it work.. e.g. tcp::resolver::iterator endpoint_iterator = resolver.resolve(query); tcp::resolver::iterator end; tcp::socket socket(io_service); boost::system::error_code error = boost::asio::error::host_not_found; while (error && endpoint_iterator != end) // <<< Question:here { socket.close(); socket.connect(*endpoint_iterator++, error); } thanks.
Gavin Rogers wrote:
I am going through the tutorial on asio at http://www.boost.org/doc/libs/1_37_0/doc/html/boost_asio/tutorial/tutdaytime...
and so far so good. I have a question, the end iterator doesn't seem to be assigned a value, in the examples. I was wondering how does it work..
e.g.
tcp::resolver::iterator endpoint_iterator = resolver.resolve(query); tcp::resolver::iterator end;
It seems the `end' is initializing by default constructor for tcp::resolver::iterator type.
participants (2)
-
Dmitry Vinogradov
-
Gavin Rogers