Merge pull request #69 from severin-lemaignan/auto-ptr-guards

Add pragma guards around deprecated auto_ptr to prevent GCC warnings
This commit is contained in:
Davis E. King 2016-01-14 18:47:23 -05:00
commit 80e6443d83
2 changed files with 12 additions and 1 deletions

View File

@ -294,6 +294,8 @@ namespace dlib
shared_node->ref_count += 1;
}
#pragma GCC diagnostic push
#pragma GCC diagnostic ignored "-Wdeprecated-declarations"
template<typename Y>
explicit shared_ptr(
std::auto_ptr<Y>& r
@ -308,6 +310,7 @@ namespace dlib
shared_node->del = new default_deleter;
data = r.release();
}
#pragma GCC diagnostic pop
shared_ptr& operator= (
const shared_ptr& r
@ -326,6 +329,8 @@ namespace dlib
return *this;
}
#pragma GCC diagnostic push
#pragma GCC diagnostic ignored "-Wdeprecated-declarations"
template<typename Y>
shared_ptr& operator= (
std::auto_ptr<Y>& r
@ -343,6 +348,7 @@ namespace dlib
data = r.release();
return *this;
}
#pragma GCC diagnostic pop
void reset()
{

View File

@ -257,7 +257,8 @@ namespace dlib
}
}
#pragma GCC diagnostic push
#pragma GCC diagnostic ignored "-Wdeprecated-declarations"
template<typename Y>
explicit shared_ptr_thread_safe(
std::auto_ptr<Y>& r
@ -271,6 +272,7 @@ namespace dlib
shared_node = new shared_ptr_thread_safe_node;
data = r.release();
}
#pragma GCC diagnostic push
shared_ptr_thread_safe& operator= (
const shared_ptr_thread_safe& r
@ -289,6 +291,8 @@ namespace dlib
return *this;
}
#pragma GCC diagnostic push
#pragma GCC diagnostic ignored "-Wdeprecated-declarations"
template<typename Y>
shared_ptr_thread_safe& operator= (
std::auto_ptr<Y>& r
@ -305,6 +309,7 @@ namespace dlib
data = r.release();
return *this;
}
#pragma GCC diagnostic push
void reset()
{