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
e8b9dd26
Commit
e8b9dd26
authored
Apr 30, 2016
by
Wenzel Jakob
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fixed docstring generation for void pointers
parent
fd7cf51a
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
6 additions
and
2 deletions
+6
-2
example/example14.cpp
+1
-1
example/example14.py
+2
-0
include/pybind11/cast.h
+1
-0
include/pybind11/functional.h
+2
-1
No files found.
example/example14.cpp
View file @
e8b9dd26
...
@@ -19,7 +19,7 @@ public:
...
@@ -19,7 +19,7 @@ public:
};
};
/* IMPORTANT: Disable internal pybind11 translation mechanisms for STL data structures */
/* IMPORTANT: Disable internal pybind11 translation mechanisms for STL data structures */
PYBIND11_MAKE_OPAQUE
(
StringList
);
PYBIND11_MAKE_OPAQUE
(
StringList
);
void
init_ex14
(
py
::
module
&
m
)
{
void
init_ex14
(
py
::
module
&
m
)
{
py
::
class_
<
StringList
>
(
m
,
"StringList"
)
py
::
class_
<
StringList
>
(
m
,
"StringList"
)
...
...
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