diff options
author | Boris Kolpackov <boris@codesynthesis.com> | 2012-04-26 18:09:51 +0200 |
---|---|---|
committer | Boris Kolpackov <boris@codesynthesis.com> | 2012-04-26 18:09:51 +0200 |
commit | c6d9dc0b7cbed43b8fcca891ddded06f66a0a798 (patch) | |
tree | d8dbabde6674fe8ea91039b21cf26476bb9689b1 | |
parent | 33c8b712edde86572443a0200169262240d2d974 (diff) |
Replace remaining std::auto_ptr uses with odb::details::unique_ptr
GCC in C++11 mode issues a deprecation warning for std::auto_ptr.
-rw-r--r-- | odb/details/posix/thread.cxx | 5 | ||||
-rw-r--r-- | odb/details/posix/tls.txx | 5 | ||||
-rw-r--r-- | odb/details/win32/thread.cxx | 5 | ||||
-rw-r--r-- | odb/details/win32/tls.txx | 7 |
4 files changed, 8 insertions, 14 deletions
diff --git a/odb/details/posix/thread.cxx b/odb/details/posix/thread.cxx index 67c4c53..669e196 100644 --- a/odb/details/posix/thread.cxx +++ b/odb/details/posix/thread.cxx @@ -2,8 +2,7 @@ // copyright : Copyright (c) 2009-2012 Code Synthesis Tools CC // license : GNU GPL v2; see accompanying LICENSE file -#include <memory> // std::auto_ptr - +#include <odb/details/unique-ptr.hxx> #include <odb/details/posix/thread.hxx> #include <odb/details/posix/exceptions.hxx> @@ -33,7 +32,7 @@ namespace odb thread (void* (*func) (void*), void* arg) : detached_ (false) { - std::auto_ptr<thread_data> data (new thread_data); + unique_ptr<thread_data> data (new thread_data); data->func = func; data->arg = arg; diff --git a/odb/details/posix/tls.txx b/odb/details/posix/tls.txx index d9bf523..69cb537 100644 --- a/odb/details/posix/tls.txx +++ b/odb/details/posix/tls.txx @@ -2,8 +2,7 @@ // copyright : Copyright (c) 2009-2012 Code Synthesis Tools CC // license : GNU GPL v2; see accompanying LICENSE file -#include <memory> // std::auto_ptr - +#include <odb/details/unique-ptr.hxx> #include <odb/details/posix/exceptions.hxx> namespace odb @@ -34,7 +33,7 @@ namespace odb if (void* v = pthread_getspecific (key_)) return *static_cast<T*> (v); - std::auto_ptr<T> p (new T); + unique_ptr<T> p (new T); if ((e = pthread_setspecific (key_, p.get ()))) throw posix_exception (e); diff --git a/odb/details/win32/thread.cxx b/odb/details/win32/thread.cxx index 2c6e337..f51b949 100644 --- a/odb/details/win32/thread.cxx +++ b/odb/details/win32/thread.cxx @@ -9,8 +9,7 @@ #include <windows.h> #include <process.h> // _beginthreadex, _endthreadex -#include <memory> // std::auto_ptr - +#include <odb/details/unique-ptr.hxx> #include <odb/details/win32/thread.hxx> #include <odb/details/win32/exceptions.hxx> @@ -60,7 +59,7 @@ namespace odb thread:: thread (void* (*func) (void*), void* arg) { - std::auto_ptr<data> d (new data); + unique_ptr<data> d (new data); d->func = func; d->arg = arg; d->count = 2; // One for the thread and one for us. diff --git a/odb/details/win32/tls.txx b/odb/details/win32/tls.txx index 7ce5821..4e3b9ab 100644 --- a/odb/details/win32/tls.txx +++ b/odb/details/win32/tls.txx @@ -2,12 +2,9 @@ // copyright : Copyright (c) 2009-2012 Code Synthesis Tools CC // license : GNU GPL v2; see accompanying LICENSE file -#include <memory> // std::auto_ptr - +#include <odb/details/unique-ptr.hxx> #include <odb/details/win32/exceptions.hxx> -using namespace std; - namespace odb { namespace details @@ -29,7 +26,7 @@ namespace odb if (void* v = _get (key_)) return *static_cast<T*> (v); - auto_ptr<T> p (new T); + unique_ptr<T> p (new T); _set (key_, p.get ()); T& r (*p); |