From 7bc0aecc3d80e8d105be68f329ede4a8c3a3fc6e Mon Sep 17 00:00:00 2001 From: Johnny Willemsen Date: Fri, 21 Aug 2020 11:16:06 +0200 Subject: With C++11 make use of std::unique_ptr * ACE/examples/APG/Naming/Name_Binding.h: * ACE/examples/APG/Reactor/HAStatus.cpp: --- ACE/examples/APG/Naming/Name_Binding.h | 4 ++++ ACE/examples/APG/Reactor/HAStatus.cpp | 6 +++++- 2 files changed, 9 insertions(+), 1 deletion(-) (limited to 'ACE/examples') 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_Ptr; +#else typedef auto_ptr 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 p (client); +#else auto_ptr p (client); +#endif if (this->acceptor_.accept (client->peer ()) == -1) ACE_ERROR_RETURN ((LM_ERROR, -- cgit v1.2.1