diff options
author | cdgill <cdgill@ae88bc3d-4319-0410-8dbf-d08b4c9d3795> | 1999-08-03 21:13:54 +0000 |
---|---|---|
committer | cdgill <cdgill@ae88bc3d-4319-0410-8dbf-d08b4c9d3795> | 1999-08-03 21:13:54 +0000 |
commit | e7366f8d706842db9caea1b2aa9f333ee87b6367 (patch) | |
tree | 27298fc7ef041675debcec5227056067f249c851 /ace/Auto_Ptr.h | |
parent | 8e4b80c2beebf8ca2f85279edf5a28e71cdd8417 (diff) | |
download | ATCD-e7366f8d706842db9caea1b2aa9f333ee87b6367.tar.gz |
added ACE_AUTO_PTR_RESET macro
Diffstat (limited to 'ace/Auto_Ptr.h')
-rw-r--r-- | ace/Auto_Ptr.h | 21 |
1 files changed, 21 insertions, 0 deletions
diff --git a/ace/Auto_Ptr.h b/ace/Auto_Ptr.h index 1fb575c8c12..ac4f2e69a66 100644 --- a/ace/Auto_Ptr.h +++ b/ace/Auto_Ptr.h @@ -123,6 +123,27 @@ public: X *operator-> () const; }; +// 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 the following ACE_AUTO_PTR_RESET macro. +# if defined (ACE_AUTO_PTR_LACKS_RESET) +# define ACE_AUTO_PTR_RESET(X,Y) \ + do { \ + if (Y != X.get ()) \ + { \ + X.release (); \ + X = Y; \ + } \ + } while (0) +# else /* ! ACE_AUTO_PTR_LACKS_RESET */ +# define ACE_AUTO_PTR_RESET(X,Y) \ + do { \ + X.reset (Y); \ + } while (0) +# endif /* ACE_AUTO_PTR_LACKS_RESET */ + + #if defined (__ACE_INLINE__) #include "ace/Auto_Ptr.i" #endif /* __ACE_INLINE__ */ |