summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJohnny Willemsen <jwillemsen@remedy.nl>2018-06-15 11:34:41 +0200
committerGitHub <noreply@github.com>2018-06-15 11:34:41 +0200
commit5e0d93921e50d796125c52e9ac63121d30fc2dbe (patch)
treeb7828f8932842b4906f930937a64585682046cb0
parent22216240d34866d73e23e0e94b207b8031f1dbc2 (diff)
parentcfa4831d01916c0835db5c52cb3a99bf1c4ad067 (diff)
downloadATCD-5e0d93921e50d796125c52e9ac63121d30fc2dbe.tar.gz
Merge pull request #639 from jwillemsen/jwi-boundptr
When we have C++11 ACE_Strong_Bound_Ptr doesn't provide std::auto_ptr…
-rw-r--r--ACE/NEWS4
-rw-r--r--ACE/ace/Bound_Ptr.h8
-rw-r--r--ACE/ace/Bound_Ptr.inl4
-rw-r--r--ACE/tests/Bound_Ptr_Test.cpp4
-rw-r--r--TAO/orbsvcs/orbsvcs/Notify/ThreadPool_Task.h1
5 files changed, 20 insertions, 1 deletions
diff --git a/ACE/NEWS b/ACE/NEWS
index 0e8f104d197..fb400f3cefd 100644
--- a/ACE/NEWS
+++ b/ACE/NEWS
@@ -1,6 +1,10 @@
USER VISIBLE CHANGES BETWEEN ACE-6.5.0 and ACE-6.5.1
====================================================
+. At the moment C++11 or newer is enabled ACE_Strong_Bound_Ptr
+ doesn't provide the convenience functions to use a
+ std::auto_ptr anymore
+
USER VISIBLE CHANGES BETWEEN ACE-6.4.8 and ACE-6.5.0
====================================================
diff --git a/ACE/ace/Bound_Ptr.h b/ACE/ace/Bound_Ptr.h
index 46123c1ee43..4d07c5417d9 100644
--- a/ACE/ace/Bound_Ptr.h
+++ b/ACE/ace/Bound_Ptr.h
@@ -20,7 +20,9 @@
# pragma once
#endif /* ACE_LACKS_PRAGMA_ONCE */
-#include "ace/Auto_Ptr.h"
+#if !defined (ACE_HAS_CPP11)
+# include "ace/Auto_Ptr.h"
+#endif /* !ACE_HAS_CPP11 */
ACE_BEGIN_VERSIONED_NAMESPACE_DECL
@@ -114,9 +116,11 @@ public:
/// object \<p\> immediately.
explicit ACE_Strong_Bound_Ptr (X *p = 0);
+#if !defined (ACE_HAS_CPP11)
/// Constructor that initializes an ACE_Strong_Bound_Ptr by stealing
/// ownership of an object from an auto_ptr.
explicit ACE_Strong_Bound_Ptr (auto_ptr<X> p);
+#endif /* !ACE_HAS_CPP11 */
/// Copy constructor binds @c this and @a r to the same object.
ACE_Strong_Bound_Ptr (const ACE_Strong_Bound_Ptr<X, ACE_LOCK> &r);
@@ -214,10 +218,12 @@ public:
/// underlying object.
void reset (X *p = 0);
+#if !defined (ACE_HAS_CPP11)
/// Resets the ACE_Strong_Bound_Ptr to refer to a different
/// underlying object, ownership of which is stolen from the
/// auto_ptr.
void reset (auto_ptr<X> p);
+#endif /* !ACE_HAS_CPP11 */
/// Allows us to check for NULL on all ACE_Strong_Bound_Ptr
/// objects.
diff --git a/ACE/ace/Bound_Ptr.inl b/ACE/ace/Bound_Ptr.inl
index 4acc85e6e05..826c9aa9898 100644
--- a/ACE/ace/Bound_Ptr.inl
+++ b/ACE/ace/Bound_Ptr.inl
@@ -146,12 +146,14 @@ ACE_Strong_Bound_Ptr<X, ACE_LOCK>::ACE_Strong_Bound_Ptr (X *p)
{
}
+#if !defined (ACE_HAS_CPP11)
template <class X, class ACE_LOCK> inline
ACE_Strong_Bound_Ptr<X, ACE_LOCK>::ACE_Strong_Bound_Ptr (auto_ptr<X> p)
: counter_ (COUNTER::create_strong ()),
ptr_ (p.release())
{
}
+#endif /* !ACE_HAS_CPP11 */
template <class X, class ACE_LOCK> inline
ACE_Strong_Bound_Ptr<X, ACE_LOCK>::ACE_Strong_Bound_Ptr (const ACE_Strong_Bound_Ptr<X, ACE_LOCK> &r)
@@ -301,6 +303,7 @@ ACE_Strong_Bound_Ptr<X, ACE_LOCK>::reset (X *p)
delete old_ptr;
}
+#if !defined (ACE_HAS_CPP11)
template<class X, class ACE_LOCK> inline void
ACE_Strong_Bound_Ptr<X, ACE_LOCK>::reset (auto_ptr<X> p)
{
@@ -311,6 +314,7 @@ ACE_Strong_Bound_Ptr<X, ACE_LOCK>::reset (auto_ptr<X> p)
if (COUNTER::detach_strong (old_counter) == 0)
delete old_ptr;
}
+#endif /* !ACE_HAS_CPP11 */
template <class X, class ACE_LOCK> inline
ACE_Weak_Bound_Ptr<X, ACE_LOCK>::ACE_Weak_Bound_Ptr (X *p)
diff --git a/ACE/tests/Bound_Ptr_Test.cpp b/ACE/tests/Bound_Ptr_Test.cpp
index 9014cf37c24..08e15f74937 100644
--- a/ACE/tests/Bound_Ptr_Test.cpp
+++ b/ACE/tests/Bound_Ptr_Test.cpp
@@ -464,9 +464,13 @@ run_main (int, ACE_TCHAR *[])
Printer ("I am printer 2"),
-1);
+#if !defined (ACE_HAS_CPP11)
// Ownership is transferred from the auto_ptr to the strong pointer.
auto_ptr<Printer> a (printer2);
Printer_var r (a);
+#else
+ Printer_var r (printer2);
+#endif /* !ACE_HAS_CPP11 */
for (int i = 0; i < n_loops; i++)
// Spawn off the methods, which run in a separate thread as
diff --git a/TAO/orbsvcs/orbsvcs/Notify/ThreadPool_Task.h b/TAO/orbsvcs/orbsvcs/Notify/ThreadPool_Task.h
index 2cc811469f3..c556b0dd5e7 100644
--- a/TAO/orbsvcs/orbsvcs/Notify/ThreadPool_Task.h
+++ b/TAO/orbsvcs/orbsvcs/Notify/ThreadPool_Task.h
@@ -21,6 +21,7 @@
#include "ace/Message_Queue.h"
#include "ace/Reactor.h"
#include "ace/Null_Condition.h"
+#include "ace/Auto_Ptr.h"
#if !defined (ACE_LACKS_PRAGMA_ONCE)
# pragma once