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
69e1a5c9
Commit
69e1a5c9
authored
May 26, 2016
by
Wenzel Jakob
Browse files
quenched warnings on windows, comments in gil_scoped_release
parent
86d825f3
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
11 additions
and
6 deletions
+11
-6
include/pybind11/cast.h
include/pybind11/cast.h
+1
-1
include/pybind11/pybind11.h
include/pybind11/pybind11.h
+10
-5
No files found.
include/pybind11/cast.h
View file @
69e1a5c9
...
@@ -660,7 +660,7 @@ public:
...
@@ -660,7 +660,7 @@ public:
std
::
get
<
1
>
(
value
).
load
(
kwargs
,
convert
);
std
::
get
<
1
>
(
value
).
load
(
kwargs
,
convert
);
return
true
;
return
true
;
}
}
static
handle
cast
(
const
type
&
src
,
return_value_policy
policy
,
handle
parent
)
{
static
handle
cast
(
const
type
&
src
,
return_value_policy
policy
,
handle
parent
)
{
return
cast
(
src
,
policy
,
parent
,
typename
make_index_sequence
<
size
>::
type
());
return
cast
(
src
,
policy
,
parent
,
typename
make_index_sequence
<
size
>::
type
());
}
}
...
...
include/pybind11/pybind11.h
View file @
69e1a5c9
...
@@ -969,7 +969,7 @@ template <typename... Args> struct init {
...
@@ -969,7 +969,7 @@ template <typename... Args> struct init {
typename
std
::
enable_if
<
std
::
is_same
<
Base
,
Alias
>
::
value
,
int
>::
type
=
0
>
typename
std
::
enable_if
<
std
::
is_same
<
Base
,
Alias
>
::
value
,
int
>::
type
=
0
>
void
execute
(
pybind11
::
class_
<
Base
,
Holder
,
Alias
>
&
class_
,
const
Extra
&
...
extra
)
const
{
void
execute
(
pybind11
::
class_
<
Base
,
Holder
,
Alias
>
&
class_
,
const
Extra
&
...
extra
)
const
{
/// Function which calls a specific C++ in-place constructor
/// Function which calls a specific C++ in-place constructor
class_
.
def
(
"__init__"
,
[](
Base
*
self
,
Args
...
args
)
{
new
(
self
)
Base
(
args
...);
},
extra
...);
class_
.
def
(
"__init__"
,
[](
Base
*
self
_
,
Args
...
args
)
{
new
(
self
_
)
Base
(
args
...);
},
extra
...);
}
}
template
<
typename
Base
,
typename
Holder
,
typename
Alias
,
typename
...
Extra
,
template
<
typename
Base
,
typename
Holder
,
typename
Alias
,
typename
...
Extra
,
...
@@ -977,11 +977,11 @@ template <typename... Args> struct init {
...
@@ -977,11 +977,11 @@ template <typename... Args> struct init {
std
::
is_constructible
<
Base
,
Args
...
>::
value
,
int
>::
type
=
0
>
std
::
is_constructible
<
Base
,
Args
...
>::
value
,
int
>::
type
=
0
>
void
execute
(
pybind11
::
class_
<
Base
,
Holder
,
Alias
>
&
class_
,
const
Extra
&
...
extra
)
const
{
void
execute
(
pybind11
::
class_
<
Base
,
Holder
,
Alias
>
&
class_
,
const
Extra
&
...
extra
)
const
{
handle
cl_type
=
class_
;
handle
cl_type
=
class_
;
class_
.
def
(
"__init__"
,
[
cl_type
](
handle
self
,
Args
...
args
)
{
class_
.
def
(
"__init__"
,
[
cl_type
](
handle
self
_
,
Args
...
args
)
{
if
(
self
.
get_type
()
==
cl_type
)
if
(
self
_
.
get_type
()
==
cl_type
)
new
(
self
.
cast
<
Base
*>
())
Base
(
args
...);
new
(
self
_
.
cast
<
Base
*>
())
Base
(
args
...);
else
else
new
(
self
.
cast
<
Alias
*>
())
Alias
(
args
...);
new
(
self
_
.
cast
<
Alias
*>
())
Alias
(
args
...);
},
extra
...);
},
extra
...);
}
}
...
@@ -1074,6 +1074,11 @@ template <typename InputType, typename OutputType> void implicitly_convertible()
...
@@ -1074,6 +1074,11 @@ template <typename InputType, typename OutputType> void implicitly_convertible()
* can be handy to prevent cases where callbacks issued from an external
* can be handy to prevent cases where callbacks issued from an external
* thread would otherwise constantly construct and destroy thread state data
* thread would otherwise constantly construct and destroy thread state data
* structures.
* structures.
*
* See the Python bindings of NanoGUI (http://github.com/wjakob/nanogui) for an
* example which uses features 2 and 3 to migrate the Python thread of
* execution to another thread (to run the event loop on the original thread,
* in this case).
*/
*/
class
gil_scoped_acquire
{
class
gil_scoped_acquire
{
...
...
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