Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
OpenDAS
dlib
Commits
a9a1633f
Commit
a9a1633f
authored
Jan 21, 2018
by
Davis King
Browse files
Removed auto_ptr from these old smart pointers since auto_ptr is officially
removed in C++17 from the standard library.
parent
d9b6f001
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
0 additions
and
151 deletions
+0
-151
dlib/smart_pointers/shared_ptr.h
dlib/smart_pointers/shared_ptr.h
+0
-45
dlib/smart_pointers/shared_ptr_abstract.h
dlib/smart_pointers/shared_ptr_abstract.h
+0
-32
dlib/smart_pointers/shared_ptr_thread_safe.h
dlib/smart_pointers/shared_ptr_thread_safe.h
+0
-42
dlib/smart_pointers/shared_ptr_thread_safe_abstract.h
dlib/smart_pointers/shared_ptr_thread_safe_abstract.h
+0
-32
No files found.
dlib/smart_pointers/shared_ptr.h
View file @
a9a1633f
...
@@ -10,14 +10,6 @@
...
@@ -10,14 +10,6 @@
#include "../algs.h"
#include "../algs.h"
#include "shared_ptr_abstract.h"
#include "shared_ptr_abstract.h"
// Don't warn about the use of std::auto_ptr in this file. There is a pragma at the end of
// this file that re-enables the warning.
#if (defined(__GNUC__) && ((__GNUC__ >= 4 && __GNUC_MINOR__ >= 6) || (__GNUC__ > 4))) || \
(defined(__clang__) && ((__clang_major__ >= 3 && __clang_minor__ >= 4)))
#pragma GCC diagnostic push
#pragma GCC diagnostic ignored "-Wdeprecated-declarations"
#endif
namespace
dlib
namespace
dlib
{
{
...
@@ -301,21 +293,6 @@ namespace dlib
...
@@ -301,21 +293,6 @@ namespace dlib
shared_node
->
ref_count
+=
1
;
shared_node
->
ref_count
+=
1
;
}
}
template
<
typename
Y
>
explicit
shared_ptr
(
std
::
auto_ptr
<
Y
>&
r
)
{
DLIB_ASSERT
(
r
.
get
()
!=
0
,
"
\t
shared_ptr::shared_ptr(auto_ptr r)"
<<
"
\n\t
r.get() can't be null"
<<
"
\n\t
this: "
<<
this
);
shared_node
=
new
shared_ptr_node
;
shared_node
->
del
=
new
default_deleter
;
data
=
r
.
release
();
}
shared_ptr
&
operator
=
(
shared_ptr
&
operator
=
(
const
shared_ptr
&
r
const
shared_ptr
&
r
)
)
...
@@ -333,24 +310,6 @@ namespace dlib
...
@@ -333,24 +310,6 @@ namespace dlib
return
*
this
;
return
*
this
;
}
}
template
<
typename
Y
>
shared_ptr
&
operator
=
(
std
::
auto_ptr
<
Y
>&
r
)
{
DLIB_ASSERT
(
r
.
get
()
!=
0
,
"
\t
shared_ptr::operator=(auto_ptr r)"
<<
"
\n\t
r.get() can't be null"
<<
"
\n\t
this: "
<<
this
);
reset
();
shared_node
=
new
shared_ptr_node
;
shared_node
->
del
=
new
default_deleter
;
data
=
r
.
release
();
return
*
this
;
}
void
reset
()
void
reset
()
{
{
shared_ptr
().
swap
(
*
this
);
shared_ptr
().
swap
(
*
this
);
...
@@ -528,10 +487,6 @@ namespace dlib
...
@@ -528,10 +487,6 @@ namespace dlib
}
}
#if (defined(__GNUC__) && ((__GNUC__ >= 4 && __GNUC_MINOR__ >= 6) || (__GNUC__ > 4))) || \
(defined(__clang__) && ((__clang_major__ >= 3 && __clang_minor__ >= 4)))
#pragma GCC diagnostic pop
#endif
#endif // DLIB_SHARED_PTr_
#endif // DLIB_SHARED_PTr_
dlib/smart_pointers/shared_ptr_abstract.h
View file @
a9a1633f
...
@@ -136,24 +136,6 @@ namespace dlib
...
@@ -136,24 +136,6 @@ namespace dlib
this exception is thrown if r.expired() == true
this exception is thrown if r.expired() == true
!*/
!*/
template
<
typename
Y
>
explicit
shared_ptr
(
std
::
auto_ptr
<
Y
>&
r
);
/*!
requires
- p.get() != 0
- p.release() is convertible to a T* type pointer
- p.release() can be deleted by calling "delete p.release();" and doing so will not throw exceptions
ensures
- #get() == p.release()
- #use_count() == 1
- #r.get() == 0
- #*this object owns the pointer p.release()
throws
- std::bad_alloc
!*/
~
shared_ptr
(
~
shared_ptr
(
);
);
/*!
/*!
...
@@ -190,20 +172,6 @@ namespace dlib
...
@@ -190,20 +172,6 @@ namespace dlib
- returns #*this
- returns #*this
!*/
!*/
template
<
typename
Y
>
shared_ptr
&
operator
=
(
std
::
auto_ptr
<
Y
>&
r
);
/*!
requires
- p.get() != 0
- p.release() is convertible to a T* type pointer
- p.release() can be deleted by calling "delete p.release();" and doing so will not throw exceptions
ensures
- equivalent to shared_ptr(r).swap(*this).
- returns #*this
!*/
void
reset
(
void
reset
(
);
);
/*!
/*!
...
...
dlib/smart_pointers/shared_ptr_thread_safe.h
View file @
a9a1633f
...
@@ -11,13 +11,6 @@
...
@@ -11,13 +11,6 @@
#include "shared_ptr_thread_safe_abstract.h"
#include "shared_ptr_thread_safe_abstract.h"
#include "../threads/threads_kernel.h"
#include "../threads/threads_kernel.h"
// Don't warn about the use of std::auto_ptr in this file. There is a pragma at the end of
// this file that re-enables the warning.
#if defined(__GNUC__) && ((__GNUC__ >= 4 && __GNUC_MINOR__ >= 6) || (__GNUC__ > 4))
#pragma GCC diagnostic push
#pragma GCC diagnostic ignored "-Wdeprecated-declarations"
#endif
namespace
dlib
namespace
dlib
{
{
...
@@ -264,20 +257,6 @@ namespace dlib
...
@@ -264,20 +257,6 @@ namespace dlib
}
}
}
}
template
<
typename
Y
>
explicit
shared_ptr_thread_safe
(
std
::
auto_ptr
<
Y
>&
r
)
{
DLIB_ASSERT
(
r
.
get
()
!=
0
,
"
\t
shared_ptr::shared_ptr_thread_safe(auto_ptr r)"
<<
"
\n\t
r.get() can't be null"
<<
"
\n\t
this: "
<<
this
);
shared_node
=
new
shared_ptr_thread_safe_node
;
data
=
r
.
release
();
}
shared_ptr_thread_safe
&
operator
=
(
shared_ptr_thread_safe
&
operator
=
(
const
shared_ptr_thread_safe
&
r
const
shared_ptr_thread_safe
&
r
)
)
...
@@ -295,23 +274,6 @@ namespace dlib
...
@@ -295,23 +274,6 @@ namespace dlib
return
*
this
;
return
*
this
;
}
}
template
<
typename
Y
>
shared_ptr_thread_safe
&
operator
=
(
std
::
auto_ptr
<
Y
>&
r
)
{
DLIB_ASSERT
(
r
.
get
()
!=
0
,
"
\t
shared_ptr::operator=(auto_ptr r)"
<<
"
\n\t
r.get() can't be null"
<<
"
\n\t
this: "
<<
this
);
reset
();
shared_node
=
new
shared_ptr_thread_safe_node
;
data
=
r
.
release
();
return
*
this
;
}
void
reset
()
void
reset
()
{
{
shared_ptr_thread_safe
().
swap
(
*
this
);
shared_ptr_thread_safe
().
swap
(
*
this
);
...
@@ -494,10 +456,6 @@ namespace dlib
...
@@ -494,10 +456,6 @@ namespace dlib
// ----------------------------------------------------------------------------------------
// ----------------------------------------------------------------------------------------
#if defined(__GNUC__) && ((__GNUC__ >= 4 && __GNUC_MINOR__ >= 6) || (__GNUC__ > 4))
#pragma GCC diagnostic pop
#endif
}
}
#endif // DLIB_SHARED_THREAD_SAFE_PTr_
#endif // DLIB_SHARED_THREAD_SAFE_PTr_
...
...
dlib/smart_pointers/shared_ptr_thread_safe_abstract.h
View file @
a9a1633f
...
@@ -114,24 +114,6 @@ namespace dlib
...
@@ -114,24 +114,6 @@ namespace dlib
a shared_ptr_thread_safe object that shares ownership with r.
a shared_ptr_thread_safe object that shares ownership with r.
!*/
!*/
template
<
typename
Y
>
explicit
shared_ptr_thread_safe
(
std
::
auto_ptr
<
Y
>&
r
);
/*!
requires
- p.get() != 0
- p.release() is convertible to a T* type pointer
- p.release() can be deleted by calling "delete p.release();" and doing so will not throw exceptions
ensures
- #get() == p.release()
- #use_count() == 1
- #r.get() == 0
- #*this object owns the pointer p.release()
throws
- std::bad_alloc
!*/
~
shared_ptr_thread_safe
(
~
shared_ptr_thread_safe
(
);
);
/*!
/*!
...
@@ -168,20 +150,6 @@ namespace dlib
...
@@ -168,20 +150,6 @@ namespace dlib
- returns #*this
- returns #*this
!*/
!*/
template
<
typename
Y
>
shared_ptr_thread_safe
&
operator
=
(
std
::
auto_ptr
<
Y
>&
r
);
/*!
requires
- p.get() != 0
- p.release() is convertible to a T* type pointer
- p.release() can be deleted by calling "delete p.release();" and doing so will not throw exceptions
ensures
- equivalent to shared_ptr_thread_safe(r).swap(*this).
- returns #*this
!*/
void
reset
(
void
reset
(
);
);
/*!
/*!
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment