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
gaoqiong
pybind11
Commits
5f07face
Commit
5f07face
authored
Jan 03, 2017
by
Dean Moldovan
Committed by
Wenzel Jakob
Jan 03, 2017
Browse files
Fix pointer to reference error in type_caster on MSVC (#583)
parent
2723a388
Changes
5
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
8 additions
and
8 deletions
+8
-8
include/pybind11/cast.h
include/pybind11/cast.h
+2
-2
include/pybind11/eigen.h
include/pybind11/eigen.h
+2
-2
include/pybind11/functional.h
include/pybind11/functional.h
+1
-1
include/pybind11/numpy.h
include/pybind11/numpy.h
+1
-1
include/pybind11/pybind11.h
include/pybind11/pybind11.h
+2
-2
No files found.
include/pybind11/cast.h
View file @
5f07face
...
...
@@ -1015,14 +1015,14 @@ template <typename T> struct move_always<T, enable_if_t<all_of<
move_is_plain_type
<
T
>
,
negation
<
std
::
is_copy_constructible
<
T
>>
,
std
::
is_move_constructible
<
T
>
,
std
::
is_same
<
decltype
(
std
::
declval
<
typ
e_caster
<
T
>>
().
operator
T
&
()),
T
&>
std
::
is_same
<
decltype
(
std
::
declval
<
mak
e_caster
<
T
>>
().
operator
T
&
()),
T
&>
>::
value
>>
:
std
::
true_type
{};
template
<
typename
T
,
typename
SFINAE
=
void
>
struct
move_if_unreferenced
:
std
::
false_type
{};
template
<
typename
T
>
struct
move_if_unreferenced
<
T
,
enable_if_t
<
all_of
<
move_is_plain_type
<
T
>
,
negation
<
move_always
<
T
>>
,
std
::
is_move_constructible
<
T
>
,
std
::
is_same
<
decltype
(
std
::
declval
<
typ
e_caster
<
T
>>
().
operator
T
&
()),
T
&>
std
::
is_same
<
decltype
(
std
::
declval
<
mak
e_caster
<
T
>>
().
operator
T
&
()),
T
&>
>::
value
>>
:
std
::
true_type
{};
template
<
typename
T
>
using
move_never
=
none_of
<
move_always
<
T
>
,
move_if_unreferenced
<
T
>>
;
...
...
include/pybind11/eigen.h
View file @
5f07face
...
...
@@ -137,7 +137,7 @@ struct type_caster<Eigen::Ref<CVDerived, Options, StrideType>> {
protected:
using
Type
=
Eigen
::
Ref
<
CVDerived
,
Options
,
StrideType
>
;
using
Derived
=
typename
std
::
remove_const
<
CVDerived
>::
type
;
using
DerivedCaster
=
typ
e_caster
<
Derived
>
;
using
DerivedCaster
=
mak
e_caster
<
Derived
>
;
DerivedCaster
derived_caster
;
std
::
unique_ptr
<
Type
>
value
;
public:
...
...
@@ -158,7 +158,7 @@ template <typename Type>
struct
type_caster
<
Type
,
enable_if_t
<
is_eigen_base
<
Type
>::
value
&&
!
is_eigen_ref
<
Type
>::
value
>>
{
protected:
using
Matrix
=
Eigen
::
Matrix
<
typename
Type
::
Scalar
,
Eigen
::
Dynamic
,
Eigen
::
Dynamic
>
;
using
MatrixCaster
=
typ
e_caster
<
Matrix
>
;
using
MatrixCaster
=
mak
e_caster
<
Matrix
>
;
public:
[[
noreturn
]]
bool
load
(
handle
,
bool
)
{
pybind11_fail
(
"Unable to load() into specialized EigenBase object"
);
}
static
handle
cast
(
const
Type
&
src
,
return_value_policy
policy
,
handle
parent
)
{
return
MatrixCaster
::
cast
(
Matrix
(
src
),
policy
,
parent
);
}
...
...
include/pybind11/functional.h
View file @
5f07face
...
...
@@ -73,7 +73,7 @@ public:
PYBIND11_TYPE_CASTER
(
type
,
_
(
"Callable[["
)
+
argument_loader
<
Args
...
>::
arg_names
()
+
_
(
"], "
)
+
typ
e_caster
<
retval_type
>::
name
()
+
mak
e_caster
<
retval_type
>::
name
()
+
_
(
"]"
));
};
...
...
include/pybind11/numpy.h
View file @
5f07face
...
...
@@ -1140,7 +1140,7 @@ struct vectorize_helper {
};
template
<
typename
T
,
int
Flags
>
struct
handle_type_name
<
array_t
<
T
,
Flags
>>
{
static
PYBIND11_DESCR
name
()
{
return
_
(
"numpy.ndarray["
)
+
typ
e_caster
<
T
>::
name
()
+
_
(
"]"
);
}
static
PYBIND11_DESCR
name
()
{
return
_
(
"numpy.ndarray["
)
+
mak
e_caster
<
T
>::
name
()
+
_
(
"]"
);
}
};
NAMESPACE_END
(
detail
)
...
...
include/pybind11/pybind11.h
View file @
5f07face
...
...
@@ -1076,7 +1076,7 @@ public:
struct
capture
{
Func
func
;
};
capture
*
ptr
=
new
capture
{
std
::
forward
<
Func
>
(
func
)
};
install_buffer_funcs
([](
PyObject
*
obj
,
void
*
ptr
)
->
buffer_info
*
{
detail
::
typ
e_caster
<
type
>
caster
;
detail
::
mak
e_caster
<
type
>
caster
;
if
(
!
caster
.
load
(
obj
,
false
))
return
nullptr
;
return
new
buffer_info
(((
capture
*
)
ptr
)
->
func
(
caster
));
...
...
@@ -1480,7 +1480,7 @@ template <return_value_policy Policy = return_value_policy::reference_internal,
template
<
typename
InputType
,
typename
OutputType
>
void
implicitly_convertible
()
{
auto
implicit_caster
=
[](
PyObject
*
obj
,
PyTypeObject
*
type
)
->
PyObject
*
{
if
(
!
detail
::
typ
e_caster
<
InputType
>
().
load
(
obj
,
false
))
if
(
!
detail
::
mak
e_caster
<
InputType
>
().
load
(
obj
,
false
))
return
nullptr
;
tuple
args
(
1
);
args
[
0
]
=
obj
;
...
...
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