Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
P
pybind11
Overview
Overview
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
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
open
pybind11
Commits
f7ce7306
Commit
f7ce7306
authored
Jan 23, 2021
by
Ralf W. Grosse-Kunstleve
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Cleaning up loaded_as_raw_ptr_unowned, loaded_as_shared_ptr.
parent
49bf91f9
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
7 additions
and
12 deletions
+7
-12
include/pybind11/detail/classh_type_casters.h
+7
-12
No files found.
include/pybind11/detail/classh_type_casters.h
View file @
f7ce7306
...
@@ -232,23 +232,18 @@ struct smart_holder_type_caster_load {
...
@@ -232,23 +232,18 @@ struct smart_holder_type_caster_load {
}
}
T
*
loaded_as_raw_ptr_unowned
()
{
T
*
loaded_as_raw_ptr_unowned
()
{
// BYPASSES smart_holder type checking completely.
void
*
void_ptr
=
loaded_smhldr_ptr
->
as_raw_ptr_unowned
<
void
>
();
if
(
load_impl
.
loaded_v_h_cpptype
!=
nullptr
)
{
if
(
load_impl
.
loaded_v_h_cpptype
==
nullptr
||
load_impl
.
reinterpret_cast_deemed_ok
if
(
load_impl
.
reinterpret_cast_deemed_ok
)
{
||
load_impl
.
implicit_cast
==
nullptr
)
{
return
static_cast
<
T
*>
(
loaded_smhldr_ptr
->
vptr
.
get
());
return
static_cast
<
T
*>
(
void_ptr
);
}
if
(
load_impl
.
implicit_cast
!=
nullptr
)
{
void
*
implicit_casted
=
load_impl
.
implicit_cast
(
loaded_smhldr_ptr
->
vptr
.
get
());
return
static_cast
<
T
*>
(
implicit_casted
);
}
}
}
return
static_cast
<
T
*>
(
loaded_smhldr_ptr
->
vptr
.
get
());
void
*
implicit_casted
=
load_impl
.
implicit_cast
(
void_ptr
);
return
static_cast
<
T
*>
(
implicit_casted
);
}
}
std
::
shared_ptr
<
T
>
loaded_as_shared_ptr
()
{
std
::
shared_ptr
<
T
>
loaded_as_shared_ptr
()
{
T
*
raw_ptr
=
loaded_as_raw_ptr_unowned
();
T
*
raw_ptr
=
loaded_as_raw_ptr_unowned
();
// BYPASSES smart_holder shared_ptr tracking completely.
return
std
::
shared_ptr
<
T
>
(
loaded_smhldr_ptr
->
as_shared_ptr
<
void
>
(),
raw_ptr
);
return
std
::
shared_ptr
<
T
>
(
loaded_smhldr_ptr
->
vptr
,
raw_ptr
);
}
}
std
::
unique_ptr
<
T
>
loaded_as_unique_ptr
()
{
std
::
unique_ptr
<
T
>
loaded_as_unique_ptr
()
{
...
...
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