Skip to content

Commit 53254c4

Browse files
committed
Removing std::auto_ptr from 0.9-devel
Because compilers in C++0x mode complain that std::auto_ptr is actually deprecated, this patch changes the implementation to use raw pointers instead. This is in the interim until unique_ptr<> is actually made part of the standard or Boost so that it can be used instead.
1 parent fe28613 commit 53254c4

File tree

3 files changed

+15
-7
lines changed

3 files changed

+15
-7
lines changed

boost/network/protocol/http/client/async_impl.hpp

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,7 @@ namespace boost { namespace network { namespace http {
4949

5050
async_client(bool cache_resolved, bool follow_redirect, boost::asio::io_service & service)
5151
: connection_base(cache_resolved, follow_redirect),
52-
service_ptr(),
52+
service_ptr(0),
5353
service_(service),
5454
resolver_(service_),
5555
sentinel_(new boost::asio::io_service::work(service_))
@@ -63,6 +63,7 @@ namespace boost { namespace network { namespace http {
6363
lifetime_thread_->join();
6464
lifetime_thread_.reset();
6565
}
66+
delete service_ptr;
6667
}
6768

6869
basic_response<Tag> const request_skeleton(
@@ -76,7 +77,7 @@ namespace boost { namespace network { namespace http {
7677
return connection_->send_request(method, request_, get_body);
7778
}
7879

79-
std::auto_ptr<boost::asio::io_service> service_ptr;
80+
boost::asio::io_service * service_ptr;
8081
boost::asio::io_service & service_;
8182
resolver_type resolver_;
8283
boost::shared_ptr<boost::asio::io_service::work> sentinel_;

boost/network/protocol/http/client/pimpl.hpp

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ namespace boost { namespace network { namespace http {
3535
typedef typename resolver<Tag>::type resolver_type;
3636
friend struct basic_client_impl<Tag,version_major,version_minor>;
3737

38-
std::auto_ptr<boost::asio::io_service> service_ptr;
38+
boost::asio::io_service * service_ptr;
3939
boost::asio::io_service & service_;
4040
resolver_type resolver_;
4141

@@ -48,12 +48,14 @@ namespace boost { namespace network { namespace http {
4848

4949
sync_client(bool cache_resolved, bool follow_redirect, boost::asio::io_service & service)
5050
: connection_base(cache_resolved, follow_redirect),
51-
service_ptr(),
51+
service_ptr(0),
5252
service_(service),
5353
resolver_(service_)
5454
{}
5555

56-
~sync_client() {}
56+
~sync_client() {
57+
delete service_ptr;
58+
}
5759

5860
basic_response<Tag> const request_skeleton(basic_request<Tag> const & request_, string_type method, bool get_body) {
5961
typename connection_base::connection_ptr connection_;

boost/network/protocol/http/server/storage_base.hpp

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -22,11 +22,16 @@ namespace boost { namespace network { namespace http {
2222

2323
template <class ArgPack>
2424
server_storage_base(ArgPack const & args, has_io_service)
25-
: self_service_()
25+
: self_service_(0)
2626
, service_(args[_io_service])
2727
{}
2828

29-
std::auto_ptr<asio::io_service> self_service_;
29+
~server_storage_base() {
30+
delete self_service_;
31+
self_service_ = 0;
32+
}
33+
34+
asio::io_service * self_service_;
3035
asio::io_service & service_;
3136
};
3237

0 commit comments

Comments
 (0)