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
"git@developer.sourcefind.cn:gaoqiong/pybind11.git" did not exist on "1bbaeb3462dcb12ce0b8aeabc56f8dd7a413dbbb"
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<
...
@@ -1015,14 +1015,14 @@ template <typename T> struct move_always<T, enable_if_t<all_of<
move_is_plain_type
<
T
>
,
move_is_plain_type
<
T
>
,
negation
<
std
::
is_copy_constructible
<
T
>>
,
negation
<
std
::
is_copy_constructible
<
T
>>
,
std
::
is_move_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
{};
>::
value
>>
:
std
::
true_type
{};
template
<
typename
T
,
typename
SFINAE
=
void
>
struct
move_if_unreferenced
:
std
::
false_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
<
template
<
typename
T
>
struct
move_if_unreferenced
<
T
,
enable_if_t
<
all_of
<
move_is_plain_type
<
T
>
,
move_is_plain_type
<
T
>
,
negation
<
move_always
<
T
>>
,
negation
<
move_always
<
T
>>
,
std
::
is_move_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
{};
>::
value
>>
:
std
::
true_type
{};
template
<
typename
T
>
using
move_never
=
none_of
<
move_always
<
T
>
,
move_if_unreferenced
<
T
>>
;
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>> {
...
@@ -137,7 +137,7 @@ struct type_caster<Eigen::Ref<CVDerived, Options, StrideType>> {
protected:
protected:
using
Type
=
Eigen
::
Ref
<
CVDerived
,
Options
,
StrideType
>
;
using
Type
=
Eigen
::
Ref
<
CVDerived
,
Options
,
StrideType
>
;
using
Derived
=
typename
std
::
remove_const
<
CVDerived
>::
type
;
using
Derived
=
typename
std
::
remove_const
<
CVDerived
>::
type
;
using
DerivedCaster
=
typ
e_caster
<
Derived
>
;
using
DerivedCaster
=
mak
e_caster
<
Derived
>
;
DerivedCaster
derived_caster
;
DerivedCaster
derived_caster
;
std
::
unique_ptr
<
Type
>
value
;
std
::
unique_ptr
<
Type
>
value
;
public:
public:
...
@@ -158,7 +158,7 @@ template <typename Type>
...
@@ -158,7 +158,7 @@ template <typename Type>
struct
type_caster
<
Type
,
enable_if_t
<
is_eigen_base
<
Type
>::
value
&&
!
is_eigen_ref
<
Type
>::
value
>>
{
struct
type_caster
<
Type
,
enable_if_t
<
is_eigen_base
<
Type
>::
value
&&
!
is_eigen_ref
<
Type
>::
value
>>
{
protected:
protected:
using
Matrix
=
Eigen
::
Matrix
<
typename
Type
::
Scalar
,
Eigen
::
Dynamic
,
Eigen
::
Dynamic
>
;
using
Matrix
=
Eigen
::
Matrix
<
typename
Type
::
Scalar
,
Eigen
::
Dynamic
,
Eigen
::
Dynamic
>
;
using
MatrixCaster
=
typ
e_caster
<
Matrix
>
;
using
MatrixCaster
=
mak
e_caster
<
Matrix
>
;
public:
public:
[[
noreturn
]]
bool
load
(
handle
,
bool
)
{
pybind11_fail
(
"Unable to load() into specialized EigenBase object"
);
}
[[
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
);
}
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:
...
@@ -73,7 +73,7 @@ public:
PYBIND11_TYPE_CASTER
(
type
,
_
(
"Callable[["
)
+
PYBIND11_TYPE_CASTER
(
type
,
_
(
"Callable[["
)
+
argument_loader
<
Args
...
>::
arg_names
()
+
_
(
"], "
)
+
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 {
...
@@ -1140,7 +1140,7 @@ struct vectorize_helper {
};
};
template
<
typename
T
,
int
Flags
>
struct
handle_type_name
<
array_t
<
T
,
Flags
>>
{
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
)
NAMESPACE_END
(
detail
)
...
...
include/pybind11/pybind11.h
View file @
5f07face
...
@@ -1076,7 +1076,7 @@ public:
...
@@ -1076,7 +1076,7 @@ public:
struct
capture
{
Func
func
;
};
struct
capture
{
Func
func
;
};
capture
*
ptr
=
new
capture
{
std
::
forward
<
Func
>
(
func
)
};
capture
*
ptr
=
new
capture
{
std
::
forward
<
Func
>
(
func
)
};
install_buffer_funcs
([](
PyObject
*
obj
,
void
*
ptr
)
->
buffer_info
*
{
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
))
if
(
!
caster
.
load
(
obj
,
false
))
return
nullptr
;
return
nullptr
;
return
new
buffer_info
(((
capture
*
)
ptr
)
->
func
(
caster
));
return
new
buffer_info
(((
capture
*
)
ptr
)
->
func
(
caster
));
...
@@ -1480,7 +1480,7 @@ template <return_value_policy Policy = return_value_policy::reference_internal,
...
@@ -1480,7 +1480,7 @@ template <return_value_policy Policy = return_value_policy::reference_internal,
template
<
typename
InputType
,
typename
OutputType
>
void
implicitly_convertible
()
{
template
<
typename
InputType
,
typename
OutputType
>
void
implicitly_convertible
()
{
auto
implicit_caster
=
[](
PyObject
*
obj
,
PyTypeObject
*
type
)
->
PyObject
*
{
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
;
return
nullptr
;
tuple
args
(
1
);
tuple
args
(
1
);
args
[
0
]
=
obj
;
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