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
f99ff736
Commit
f99ff736
authored
Jun 29, 2020
by
fatvlady
Committed by
Wenzel Jakob
Jun 29, 2020
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add additional check to be more compliant with other casters
parent
8c06b954
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
3 additions
and
2 deletions
+3
-2
include/pybind11/stl.h
+3
-2
No files found.
include/pybind11/stl.h
View file @
f99ff736
...
@@ -266,8 +266,9 @@ template<typename T> struct optional_caster {
...
@@ -266,8 +266,9 @@ template<typename T> struct optional_caster {
static
handle
cast
(
T_
&&
src
,
return_value_policy
policy
,
handle
parent
)
{
static
handle
cast
(
T_
&&
src
,
return_value_policy
policy
,
handle
parent
)
{
if
(
!
src
)
if
(
!
src
)
return
none
().
inc_ref
();
return
none
().
inc_ref
();
using
dereference_type
=
decltype
(
*
std
::
forward
<
T_
>
(
src
));
if
(
!
std
::
is_lvalue_reference
<
T
>::
value
)
{
policy
=
return_value_policy_override
<
dereference_type
>::
policy
(
policy
);
policy
=
return_value_policy_override
<
T
>::
policy
(
policy
);
}
return
value_conv
::
cast
(
*
std
::
forward
<
T_
>
(
src
),
policy
,
parent
);
return
value_conv
::
cast
(
*
std
::
forward
<
T_
>
(
src
),
policy
,
parent
);
}
}
...
...
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