Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
gaoqiong
pybind11
Commits
e8b9dd26
Commit
e8b9dd26
authored
Apr 30, 2016
by
Wenzel Jakob
Browse files
fixed docstring generation for void pointers
parent
fd7cf51a
Changes
4
Show whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
6 additions
and
2 deletions
+6
-2
example/example14.cpp
example/example14.cpp
+1
-1
example/example14.py
example/example14.py
+2
-0
include/pybind11/cast.h
include/pybind11/cast.h
+1
-0
include/pybind11/functional.h
include/pybind11/functional.h
+2
-1
No files found.
example/example14.cpp
View file @
e8b9dd26
example/example14.py
View file @
e8b9dd26
...
@@ -8,6 +8,7 @@ from example import ClassWithSTLVecProperty
...
@@ -8,6 +8,7 @@ from example import ClassWithSTLVecProperty
from
example
import
return_void_ptr
,
print_void_ptr
from
example
import
return_void_ptr
,
print_void_ptr
from
example
import
return_null_str
,
print_null_str
from
example
import
return_null_str
,
print_null_str
from
example
import
return_unique_ptr
from
example
import
return_unique_ptr
from
example
import
Example1
#####
#####
...
@@ -32,6 +33,7 @@ print_opaque_list(cvp.stringList)
...
@@ -32,6 +33,7 @@ print_opaque_list(cvp.stringList)
#####
#####
print_void_ptr
(
return_void_ptr
())
print_void_ptr
(
return_void_ptr
())
print_void_ptr
(
Example1
())
# Should also work for other C++ types
print
(
return_null_str
())
print
(
return_null_str
())
print_null_str
(
return_null_str
())
print_null_str
(
return_null_str
())
...
...
include/pybind11/cast.h
View file @
e8b9dd26
...
@@ -398,6 +398,7 @@ public:
...
@@ -398,6 +398,7 @@ public:
template
<
typename
T
>
using
cast_op_type
=
void
*&
;
template
<
typename
T
>
using
cast_op_type
=
void
*&
;
operator
void
*&
()
{
return
value
;
}
operator
void
*&
()
{
return
value
;
}
static
PYBIND11_DESCR
name
()
{
return
_
(
"capsule"
);
}
private:
private:
void
*
value
=
nullptr
;
void
*
value
=
nullptr
;
};
};
...
...
include/pybind11/functional.h
View file @
e8b9dd26
...
@@ -17,6 +17,7 @@ NAMESPACE_BEGIN(detail)
...
@@ -17,6 +17,7 @@ NAMESPACE_BEGIN(detail)
template
<
typename
Return
,
typename
...
Args
>
struct
type_caster
<
std
::
function
<
Return
(
Args
...)
>>
{
template
<
typename
Return
,
typename
...
Args
>
struct
type_caster
<
std
::
function
<
Return
(
Args
...)
>>
{
typedef
std
::
function
<
Return
(
Args
...)
>
type
;
typedef
std
::
function
<
Return
(
Args
...)
>
type
;
typedef
typename
std
::
conditional
<
std
::
is_same
<
Return
,
void
>::
value
,
void_type
,
Return
>::
type
retval_type
;
public:
public:
bool
load
(
handle
src_
,
bool
)
{
bool
load
(
handle
src_
,
bool
)
{
src_
=
detail
::
get_function
(
src_
);
src_
=
detail
::
get_function
(
src_
);
...
@@ -39,7 +40,7 @@ public:
...
@@ -39,7 +40,7 @@ public:
PYBIND11_TYPE_CASTER
(
type
,
_
(
"function<"
)
+
PYBIND11_TYPE_CASTER
(
type
,
_
(
"function<"
)
+
type_caster
<
std
::
tuple
<
Args
...
>>::
name
()
+
_
(
" -> "
)
+
type_caster
<
std
::
tuple
<
Args
...
>>::
name
()
+
_
(
" -> "
)
+
type_caster
<
typename
intrinsic_type
<
Return
>::
type
>::
name
()
+
type_caster
<
retval_
type
>::
name
()
+
_
(
">"
));
_
(
">"
));
};
};
...
...
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