diff options
author | Johnny Willemsen <jwillemsen@remedy.nl> | 2020-08-21 11:16:06 +0200 |
---|---|---|
committer | Johnny Willemsen <jwillemsen@remedy.nl> | 2020-08-21 11:16:06 +0200 |
commit | 7bc0aecc3d80e8d105be68f329ede4a8c3a3fc6e (patch) | |
tree | 07d4d887e8b464ea312d546368b63b021a453058 /ACE/examples | |
parent | d5f4d848c1318e544f2f1f82f6d82e4a1361ec64 (diff) | |
download | ATCD-7bc0aecc3d80e8d105be68f329ede4a8c3a3fc6e.tar.gz |
With C++11 make use of std::unique_ptr
* ACE/examples/APG/Naming/Name_Binding.h:
* ACE/examples/APG/Reactor/HAStatus.cpp:
Diffstat (limited to 'ACE/examples')
-rw-r--r-- | ACE/examples/APG/Naming/Name_Binding.h | 4 | ||||
-rw-r--r-- | ACE/examples/APG/Reactor/HAStatus.cpp | 6 |
2 files changed, 9 insertions, 1 deletions
diff --git a/ACE/examples/APG/Naming/Name_Binding.h b/ACE/examples/APG/Naming/Name_Binding.h index a359600c634..e40c717383a 100644 --- a/ACE/examples/APG/Naming/Name_Binding.h +++ b/ACE/examples/APG/Naming/Name_Binding.h @@ -53,7 +53,11 @@ private: char *type_; }; +#if defined ACE_HAS_CPP11 +typedef std::unique_ptr<Name_Binding> Name_Binding_Ptr; +#else typedef auto_ptr<Name_Binding> Name_Binding_Ptr; +#endif // Listing 1 #endif /* NAME_BINDING_H */ diff --git a/ACE/examples/APG/Reactor/HAStatus.cpp b/ACE/examples/APG/Reactor/HAStatus.cpp index a36e5955393..c424fd86aec 100644 --- a/ACE/examples/APG/Reactor/HAStatus.cpp +++ b/ACE/examples/APG/Reactor/HAStatus.cpp @@ -93,9 +93,13 @@ ClientAcceptor::open (const ACE_INET_Addr &listen_addr) int ClientAcceptor::handle_input (ACE_HANDLE) { - ClientService *client; + ClientService *client = 0; ACE_NEW_RETURN (client, ClientService, -1); +#if defined ACE_HAS_CPP11 + std::unique_ptr<ClientService> p (client); +#else auto_ptr<ClientService> p (client); +#endif if (this->acceptor_.accept (client->peer ()) == -1) ACE_ERROR_RETURN ((LM_ERROR, |