From b8016f70eff874a90b4f18900dd5cdd1e74cb545 Mon Sep 17 00:00:00 2001 From: Johnny Willemsen Date: Thu, 25 Apr 2024 14:04:07 +0200 Subject: [PATCH 1/2] Remove Auto_Ptr.h, with C++17 auto_ptr is not available anymore * ACE/ace/Auto_Ptr.cpp: * ACE/ace/Auto_Ptr.h: * ACE/ace/Auto_Ptr.inl: Deleted. * ACE/ace/ace.mpc: * ACE/ace/ace_for_tao.mpc: * ACE/tests/Logging_Strategy_Test.cpp: --- ACE/ace/Auto_Ptr.cpp | 25 ---- ACE/ace/Auto_Ptr.h | 208 ---------------------------- ACE/ace/Auto_Ptr.inl | 181 ------------------------ ACE/ace/ace.mpc | 1 - ACE/ace/ace_for_tao.mpc | 1 - ACE/tests/Logging_Strategy_Test.cpp | 1 - 6 files changed, 417 deletions(-) delete mode 100644 ACE/ace/Auto_Ptr.cpp delete mode 100644 ACE/ace/Auto_Ptr.h delete mode 100644 ACE/ace/Auto_Ptr.inl diff --git a/ACE/ace/Auto_Ptr.cpp b/ACE/ace/Auto_Ptr.cpp deleted file mode 100644 index 88fab8cbc58e4..0000000000000 --- a/ACE/ace/Auto_Ptr.cpp +++ /dev/null @@ -1,25 +0,0 @@ -#ifndef ACE_AUTO_PTR_CPP -#define ACE_AUTO_PTR_CPP - -#include "ace/Auto_Ptr.h" - -#if !defined (ACE_HAS_CPP17) - -#if defined (ACE_HAS_ALLOC_HOOKS) -# include "ace/Malloc_Base.h" -#endif /* ACE_HAS_ALLOC_HOOKS */ - -#if !defined (__ACE_INLINE__) -#include "ace/Auto_Ptr.inl" -#endif /* __ACE_INLINE__ */ - -ACE_BEGIN_VERSIONED_NAMESPACE_DECL - -ACE_ALLOC_HOOK_DEFINE_Tt(ACE_Auto_Basic_Ptr) -ACE_ALLOC_HOOK_DEFINE_Tt(ACE_Auto_Basic_Array_Ptr) - -ACE_END_VERSIONED_NAMESPACE_DECL - -#endif /* ACE_HAS_CPP17 */ - -#endif /* ACE_AUTO_PTR_CPP */ diff --git a/ACE/ace/Auto_Ptr.h b/ACE/ace/Auto_Ptr.h deleted file mode 100644 index 4c4d97d2e013a..0000000000000 --- a/ACE/ace/Auto_Ptr.h +++ /dev/null @@ -1,208 +0,0 @@ -/* -*- C++ -*- */ - -//============================================================================= -/** - * @file Auto_Ptr.h - * - * @author Doug Schmidt - * @author Irfan Pyarali - * @author Jack Reeves - * @author Dr. Harald M. Mueller - */ -//============================================================================= - -#ifndef ACE_AUTO_PTR_H -#define ACE_AUTO_PTR_H -#include /**/ "ace/pre.h" - -#include /**/ "ace/config-all.h" - -#if !defined (ACE_LACKS_PRAGMA_ONCE) -# pragma once -#endif /* ACE_LACKS_PRAGMA_ONCE */ - -// C++17 removed std::auto_ptr<>, so also disable the ACE versions when -// using C++17. -#if !defined (ACE_HAS_CPP17) - -#if defined (_MSC_VER) -// Suppress warning e.g. "return type for -// 'ACE_Auto_Array_Pointer::operator ->' is 'type *' (i.e., not a UDT -// or reference to a UDT. Will produce errors if applied using infix -// notation)" -# pragma warning(push) -# pragma warning(disable: 4284) -#endif /* _MSC_VER */ - -ACE_BEGIN_VERSIONED_NAMESPACE_DECL - -/** - * @class ACE_Auto_Basic_Ptr - * - * @brief Implements the draft C++ standard auto_ptr abstraction. - * This class allows one to work on non-object (basic) types - */ -template -class ACE_Auto_Basic_Ptr -{ -public: - typedef X element_type; - - explicit ACE_Auto_Basic_Ptr (X * p = nullptr) : p_ (p) {} - - ACE_Auto_Basic_Ptr (ACE_Auto_Basic_Ptr & ap); - ACE_Auto_Basic_Ptr &operator= (ACE_Auto_Basic_Ptr & rhs); - ~ACE_Auto_Basic_Ptr (); - - // = Accessor methods. - X &operator *() const; - X *get () const; - X *release (); - void reset (X * p = nullptr); - - /// Dump the state of an object. - void dump () const; - - /// Declare the dynamic allocation hooks. - ACE_ALLOC_HOOK_DECLARE; - -protected: - X *p_; -}; - -ACE_END_VERSIONED_NAMESPACE_DECL - -#if !defined (ACE_LACKS_AUTO_PTR) -# include -using std::auto_ptr; -#else /* !ACE_LACKS_AUTO_PTR */ - -ACE_BEGIN_VERSIONED_NAMESPACE_DECL - -/** - * @class auto_ptr - * - * @brief Implements the draft C++ standard auto_ptr abstraction. - */ -template -class auto_ptr : public ACE_Auto_Basic_Ptr -{ -public: - typedef X element_type; - - explicit auto_ptr (X * p = 0) : ACE_Auto_Basic_Ptr (p) {} - auto_ptr (auto_ptr & ap) : ACE_Auto_Basic_Ptr (ap.release ()) {} - - X *operator-> () const; -}; - -ACE_END_VERSIONED_NAMESPACE_DECL - -#endif /* !ACE_LACKS_AUTO_PTR */ - -ACE_BEGIN_VERSIONED_NAMESPACE_DECL - -/** - * @brief Implements the draft C++ standard auto_ptr abstraction. - * This version can be used instead of auto_ptr - */ -template -class ACE_Auto_Ptr : public ACE_Auto_Basic_Ptr -{ -public: - typedef X element_type; - - explicit ACE_Auto_Ptr (X * p = 0) : ACE_Auto_Basic_Ptr (p) {} - - X *operator-> () const; -}; - -/** - * @class ACE_Auto_Basic_Array_Ptr - * - * @brief Implements an extension to the draft C++ standard auto_ptr - * abstraction. This class allows one to work on non-object - * (basic) types that must be treated as an array, e.g., - * deallocated via "delete [] foo". - */ -template -class ACE_Auto_Basic_Array_Ptr -{ -public: - typedef X element_type; - - explicit ACE_Auto_Basic_Array_Ptr (X * p = 0) : p_ (p) {} - - ACE_Auto_Basic_Array_Ptr (ACE_Auto_Basic_Array_Ptr & ap); - ACE_Auto_Basic_Array_Ptr &operator= (ACE_Auto_Basic_Array_Ptr & rhs); - ~ACE_Auto_Basic_Array_Ptr (); - - // = Accessor methods. - X & operator* () const; - X & operator[] (int i) const; - X * get () const; - X * release (); - void reset (X * p = 0); - - /// Dump the state of an object. - void dump () const; - - /// Declare the dynamic allocation hooks. - ACE_ALLOC_HOOK_DECLARE; - -protected: - X * p_; -}; - -/** - * @class ACE_Auto_Array_Ptr - * - * @brief Implements an extension to the draft C++ standard auto_ptr - * abstraction. - */ -template -class ACE_Auto_Array_Ptr : public ACE_Auto_Basic_Array_Ptr -{ -public: - typedef X element_type; - - explicit ACE_Auto_Array_Ptr (X *p = 0) - : ACE_Auto_Basic_Array_Ptr (p) {} - - X *operator-> () const; -}; - - -/** - * @brief Reset given @c auto_ptr element to new element. - * - * Some platforms have an older version of auto_ptr support, which - * lacks reset, and cannot be disabled easily. Portability to these - * platforms requires use of this function template. This function - * template also works for the @c ACE_Auto_{Basic_}Array_Ptr class - * template, as well. - */ -template -inline void -ACE_auto_ptr_reset (AUTO_PTR_TYPE & ap, PTR_TYPE * p) -{ - ap.reset (p); -} - -ACE_END_VERSIONED_NAMESPACE_DECL - -#if defined (__ACE_INLINE__) -#include "ace/Auto_Ptr.inl" -#endif /* __ACE_INLINE__ */ - -#include "ace/Auto_Ptr.cpp" - -#if defined (_MSC_VER) -// Restore the warning state to what it was before entry. -# pragma warning(pop) -#endif /* _MSC_VER */ - -#endif /* ACE_HAS_CPP17 */ - -#include /**/ "ace/post.h" -#endif /* ACE_AUTO_PTR_H */ diff --git a/ACE/ace/Auto_Ptr.inl b/ACE/ace/Auto_Ptr.inl deleted file mode 100644 index 6657f5e20013d..0000000000000 --- a/ACE/ace/Auto_Ptr.inl +++ /dev/null @@ -1,181 +0,0 @@ -// -*- C++ -*- -#include "ace/Global_Macros.h" - -#if !defined (ACE_HAS_CPP17) - -#if defined (ACE_HAS_ALLOC_HOOKS) -# include "ace/Malloc_Base.h" -#endif /* ACE_HAS_ALLOC_HOOKS */ - -ACE_BEGIN_VERSIONED_NAMESPACE_DECL - -template ACE_INLINE void -ACE_Auto_Basic_Ptr::dump () const -{ -#if defined (ACE_HAS_DUMP) - ACE_TRACE ("ACE_Auto_Basic_Ptr::dump"); -#endif /* ACE_HAS_DUMP */ -} - -template ACE_INLINE void -ACE_Auto_Basic_Array_Ptr::dump () const -{ -#if defined (ACE_HAS_DUMP) - ACE_TRACE ("ACE_Auto_Basic_Array_Ptr::dump"); -#endif /* ACE_HAS_DUMP */ -} - -template ACE_INLINE -ACE_Auto_Basic_Ptr::ACE_Auto_Basic_Ptr (ACE_Auto_Basic_Ptr &rhs) - : p_ (rhs.release ()) -{ - ACE_TRACE ("ACE_Auto_Basic_Ptr::ACE_Auto_Basic_Ptr"); -} - -template ACE_INLINE X * -ACE_Auto_Basic_Ptr::get () const -{ - ACE_TRACE ("ACE_Auto_Basic_Ptr::get"); - return this->p_; -} - -template ACE_INLINE X * -ACE_Auto_Basic_Ptr::release () -{ - ACE_TRACE ("ACE_Auto_Basic_Ptr::release"); - X *old = this->p_; - this->p_ = nullptr; - return old; -} - -template ACE_INLINE void -ACE_Auto_Basic_Ptr::reset (X *p) -{ - ACE_TRACE ("ACE_Auto_Basic_Ptr::reset"); - if (this->get () != p) - delete this->get (); - this->p_ = p; -} - -template ACE_INLINE ACE_Auto_Basic_Ptr & -ACE_Auto_Basic_Ptr::operator= (ACE_Auto_Basic_Ptr &rhs) -{ - ACE_TRACE ("ACE_Auto_Basic_Ptr::operator="); - if (this != &rhs) - { - this->reset (rhs.release ()); - } - return *this; -} - -template ACE_INLINE -ACE_Auto_Basic_Ptr::~ACE_Auto_Basic_Ptr () -{ - ACE_TRACE ("ACE_Auto_Basic_Ptr::~ACE_Auto_Basic_Ptr"); - delete this->get (); -} - -template ACE_INLINE X & -ACE_Auto_Basic_Ptr::operator *() const -{ - ACE_TRACE ("ACE_Auto_Basic_Ptr::operator *()"); - return *this->get (); -} - -#if defined (ACE_LACKS_AUTO_PTR) -template ACE_INLINE X * -auto_ptr::operator-> () const -{ - ACE_TRACE ("auto_ptr::operator->"); - return this->get (); -} -#endif /* ACE_LACKS_AUTO_PTR */ - -template ACE_INLINE X * -ACE_Auto_Ptr::operator-> () const -{ - ACE_TRACE ("ACE_Auto_Ptr::operator->"); - return this->get (); -} - -template ACE_INLINE X * -ACE_Auto_Basic_Array_Ptr::get () const -{ - ACE_TRACE ("ACE_Auto_Basic_Array_Ptr::get"); - return this->p_; -} - -template ACE_INLINE X * -ACE_Auto_Basic_Array_Ptr::release () -{ - ACE_TRACE ("ACE_Auto_Basic_Array_Ptr::release"); - X *old = this->p_; - this->p_ = 0; - return old; -} - -template ACE_INLINE void -ACE_Auto_Basic_Array_Ptr::reset (X *p) -{ - ACE_TRACE ("ACE_Auto_Basic_Array_Ptr::reset"); - if (this->get () != p) -#if defined (ACE_HAS_ALLOC_HOOKS) - ACE_Allocator::instance()->free(this->get ()); -#else - delete [] this->get (); -#endif /* ACE_HAS_ALLOC_HOOKS */ - - this->p_ = p; -} - -template ACE_INLINE -ACE_Auto_Basic_Array_Ptr::ACE_Auto_Basic_Array_Ptr (ACE_Auto_Basic_Array_Ptr &rhs) - : p_ (rhs.release ()) -{ - ACE_TRACE ("ACE_Auto_Basic_Array_Ptr::ACE_Auto_Basic_Array_Ptr"); -} - -template ACE_INLINE ACE_Auto_Basic_Array_Ptr & -ACE_Auto_Basic_Array_Ptr::operator= (ACE_Auto_Basic_Array_Ptr &rhs) -{ - ACE_TRACE ("ACE_Auto_Basic_Array_Ptr::operator="); - if (this != &rhs) - { - this->reset (rhs.release ()); - } - return *this; -} - -template ACE_INLINE -ACE_Auto_Basic_Array_Ptr::~ACE_Auto_Basic_Array_Ptr () -{ - ACE_TRACE ("ACE_Auto_Basic_Array_Ptr::~ACE_Auto_Basic_Array_Ptr"); -#if defined (ACE_HAS_ALLOC_HOOKS) - ACE_Allocator::instance()->free(this->get ()); -#else - delete [] this->get (); -#endif /* ACE_HAS_ALLOC_HOOKS */ -} - -template ACE_INLINE X & -ACE_Auto_Basic_Array_Ptr::operator *() const -{ - return *this->get (); -} - -template ACE_INLINE X & -ACE_Auto_Basic_Array_Ptr::operator[](int i) const -{ - X *array = this->get (); - return array[i]; -} - -template ACE_INLINE X * -ACE_Auto_Array_Ptr::operator->() const -{ - return this->get (); -} - -ACE_END_VERSIONED_NAMESPACE_DECL - -#endif /* ACE_HAS_CPP17 */ diff --git a/ACE/ace/ace.mpc b/ACE/ace/ace.mpc index 97e8b5fec648e..a300f062c92b5 100644 --- a/ACE/ace/ace.mpc +++ b/ACE/ace/ace.mpc @@ -297,7 +297,6 @@ project(ACE) : ace_output, acedefaults, install, other, codecs, token, svcconf, Auto_Event.cpp Auto_Functor.cpp Auto_IncDec_T.cpp - Auto_Ptr.cpp Based_Pointer_T.cpp Bound_Ptr.cpp Cache_Map_Manager_T.cpp diff --git a/ACE/ace/ace_for_tao.mpc b/ACE/ace/ace_for_tao.mpc index acb98a071afef..4c5beeb7dfea6 100644 --- a/ACE/ace/ace_for_tao.mpc +++ b/ACE/ace/ace_for_tao.mpc @@ -218,7 +218,6 @@ project(ACE_FOR_TAO) : acedefaults, install, svcconf, uuid, versioned_namespace, Auto_Event.cpp Auto_Functor.cpp Auto_IncDec_T.cpp - Auto_Ptr.cpp Based_Pointer_T.cpp Cache_Map_Manager_T.cpp Cached_Connect_Strategy_T.cpp diff --git a/ACE/tests/Logging_Strategy_Test.cpp b/ACE/tests/Logging_Strategy_Test.cpp index 9132100a912bf..13d22a2ceec69 100644 --- a/ACE/tests/Logging_Strategy_Test.cpp +++ b/ACE/tests/Logging_Strategy_Test.cpp @@ -40,7 +40,6 @@ #include "ace/Logging_Strategy.h" #endif -#include "ace/Auto_Ptr.cpp" #include "ace/Get_Opt.h" #include "ace/OS_NS_time.h" From d71bd20a9796177b10fabeeffd98ba3d383ae06f Mon Sep 17 00:00:00 2001 From: Johnny Willemsen Date: Thu, 25 Apr 2024 14:23:34 +0200 Subject: [PATCH 2/2] Document change * ACE/NEWS: --- ACE/NEWS | 3 +++ 1 file changed, 3 insertions(+) diff --git a/ACE/NEWS b/ACE/NEWS index 347b15e99b0e5..02982c59a57f7 100644 --- a/ACE/NEWS +++ b/ACE/NEWS @@ -5,6 +5,9 @@ USER VISIBLE CHANGES BETWEEN ACE-7.1.4 and ACE-7.2.0 . Add support for Embarcadero C++ Builder bcc64x compiler +. Removed ace/Auto_Ptr.*, with C++17 std::auto_ptr is not + available anymore + USER VISIBLE CHANGES BETWEEN ACE-7.1.3 and ACE-7.1.4 ====================================================