Skip to content
Projects
Groups
Snippets
Help
Loading...
Sign in
Toggle navigation
D
dlib
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
钟尚武
dlib
Commits
d873810e
Commit
d873810e
authored
Jan 14, 2016
by
Séverin Lemaignan
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add pragma guards around deprecated auto_ptr to prevent GCC warnings
Fixes #67
parent
6bd5c2e3
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
12 additions
and
1 deletion
+12
-1
shared_ptr.h
dlib/smart_pointers/shared_ptr.h
+6
-0
shared_ptr_thread_safe.h
dlib/smart_pointers/shared_ptr_thread_safe.h
+6
-1
No files found.
dlib/smart_pointers/shared_ptr.h
View file @
d873810e
...
@@ -294,6 +294,8 @@ namespace dlib
...
@@ -294,6 +294,8 @@ namespace dlib
shared_node
->
ref_count
+=
1
;
shared_node
->
ref_count
+=
1
;
}
}
#pragma GCC diagnostic push
#pragma GCC diagnostic ignored "-Wdeprecated-declarations"
template
<
typename
Y
>
template
<
typename
Y
>
explicit
shared_ptr
(
explicit
shared_ptr
(
std
::
auto_ptr
<
Y
>&
r
std
::
auto_ptr
<
Y
>&
r
...
@@ -308,6 +310,7 @@ namespace dlib
...
@@ -308,6 +310,7 @@ namespace dlib
shared_node
->
del
=
new
default_deleter
;
shared_node
->
del
=
new
default_deleter
;
data
=
r
.
release
();
data
=
r
.
release
();
}
}
#pragma GCC diagnostic pop
shared_ptr
&
operator
=
(
shared_ptr
&
operator
=
(
const
shared_ptr
&
r
const
shared_ptr
&
r
...
@@ -326,6 +329,8 @@ namespace dlib
...
@@ -326,6 +329,8 @@ namespace dlib
return
*
this
;
return
*
this
;
}
}
#pragma GCC diagnostic push
#pragma GCC diagnostic ignored "-Wdeprecated-declarations"
template
<
typename
Y
>
template
<
typename
Y
>
shared_ptr
&
operator
=
(
shared_ptr
&
operator
=
(
std
::
auto_ptr
<
Y
>&
r
std
::
auto_ptr
<
Y
>&
r
...
@@ -343,6 +348,7 @@ namespace dlib
...
@@ -343,6 +348,7 @@ namespace dlib
data
=
r
.
release
();
data
=
r
.
release
();
return
*
this
;
return
*
this
;
}
}
#pragma GCC diagnostic pop
void
reset
()
void
reset
()
{
{
...
...
dlib/smart_pointers/shared_ptr_thread_safe.h
View file @
d873810e
...
@@ -257,7 +257,8 @@ namespace dlib
...
@@ -257,7 +257,8 @@ namespace dlib
}
}
}
}
#pragma GCC diagnostic push
#pragma GCC diagnostic ignored "-Wdeprecated-declarations"
template
<
typename
Y
>
template
<
typename
Y
>
explicit
shared_ptr_thread_safe
(
explicit
shared_ptr_thread_safe
(
std
::
auto_ptr
<
Y
>&
r
std
::
auto_ptr
<
Y
>&
r
...
@@ -271,6 +272,7 @@ namespace dlib
...
@@ -271,6 +272,7 @@ namespace dlib
shared_node
=
new
shared_ptr_thread_safe_node
;
shared_node
=
new
shared_ptr_thread_safe_node
;
data
=
r
.
release
();
data
=
r
.
release
();
}
}
#pragma GCC diagnostic push
shared_ptr_thread_safe
&
operator
=
(
shared_ptr_thread_safe
&
operator
=
(
const
shared_ptr_thread_safe
&
r
const
shared_ptr_thread_safe
&
r
...
@@ -289,6 +291,8 @@ namespace dlib
...
@@ -289,6 +291,8 @@ namespace dlib
return
*
this
;
return
*
this
;
}
}
#pragma GCC diagnostic push
#pragma GCC diagnostic ignored "-Wdeprecated-declarations"
template
<
typename
Y
>
template
<
typename
Y
>
shared_ptr_thread_safe
&
operator
=
(
shared_ptr_thread_safe
&
operator
=
(
std
::
auto_ptr
<
Y
>&
r
std
::
auto_ptr
<
Y
>&
r
...
@@ -305,6 +309,7 @@ namespace dlib
...
@@ -305,6 +309,7 @@ namespace dlib
data
=
r
.
release
();
data
=
r
.
release
();
return
*
this
;
return
*
this
;
}
}
#pragma GCC diagnostic push
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