Update of /cvsroot/boost/boost/boost/asio/ip
In directory sc8-pr-cvs3.sourceforge.net:/tmp/cvs-serv17249
Modified Files:
basic_resolver_iterator.hpp
Log Message:
Don't copy a default-constructed vector iterator.
Index: basic_resolver_iterator.hpp
===================================================================
RCS file: /cvsroot/boost/boost/boost/asio/ip/basic_resolver_iterator.hpp,v
retrieving revision 1.4
retrieving revision 1.5
diff -u -d -r1.4 -r1.5
--- basic_resolver_iterator.hpp 4 Jan 2007 05:53:01 -0000 1.4
+++ basic_resolver_iterator.hpp 22 Apr 2007 07:38:55 -0000 1.5
@@ -19,6 +19,7 @@
#include <boost/asio/detail/push_options.hpp>
#include <boost/iterator/iterator_facade.hpp>
+#include <boost/optional.hpp>
#include <boost/shared_ptr.hpp>
#include <cstring>
#include <string>
@@ -119,12 +120,12 @@
void increment()
{
- if (++iter_ == values_->end())
+ if (++*iter_ == values_->end())
{
// Reset state to match a default constructed end iterator.
values_.reset();
typedef typename values_type::const_iterator values_iterator_type;
- iter_ = values_iterator_type();
+ iter_.reset();
}
}
@@ -134,17 +135,18 @@
return true;
if (values_ != other.values_)
return false;
- return iter_ == other.iter_;
+ return *iter_ == *other.iter_;
}
const basic_resolver_entry<InternetProtocol>& dereference() const
{
- return *iter_;
+ return **iter_;
}
typedef std::vector<basic_resolver_entry<InternetProtocol> > values_type;
+ typedef typename values_type::const_iterator values_iter_type;
boost::shared_ptr<values_type> values_;
- typename values_type::const_iterator iter_;
+ boost::optional<values_iter_type> iter_;
};
} // namespace ip
-------------------------------------------------------------------------
This SF.net email is sponsored by DB2 Express
Download DB2 Express C - the FREE version of DB2 express and take
control of your XML. No limits. Just data. Click to get it now.
http://sourceforge.net/powerbar/db2/
_______________________________________________
Boost-cvs mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/boost-cvs