mirror of
https://github.com/pybind/pybind11.git
synced 2025-02-19 15:10:38 +00:00
quenched warnings on windows, comments in gil_scoped_release
This commit is contained in:
parent
86d825f330
commit
69e1a5c91b
@ -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());
|
||||||
}
|
}
|
||||||
|
@ -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 {
|
|||||||
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()
|
|||||||
* 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 {
|
||||||
|
Loading…
Reference in New Issue
Block a user