- 26 Apr, 2020 2 commits
-
-
This variable is a CMake community standard to set the C++ standard of a build. Document it in favor of the previous variable, which stays as a legacy flag for existing projects. https://cmake.org/cmake/help/v3.17/variable/CMAKE_CXX_STANDARD.html
Axel Huebl committed -
Chuck Atkins committed
-
- 14 Apr, 2020 2 commits
-
-
With this change, and cast.h as-is in master, test_tagbased_polymorphic.cpp fails to compile with the error message below. With the cast.h change in pull/2016, building and testing succeeds. cd pybind11/build/tests && /usr/bin/c++ -DPYBIND11_TEST_BOOST -DPYBIND11_TEST_EIGEN -Dpybind11_tests_EXPORTS -Ipybind11/include -I/usr/include/python3.7m -isystem /usr/include/eigen3 -Os -DNDEBUG -fPIC -fvisibility=hidden -std=c++2a -flto -fno-fat-lto-objects -Wall -Wextra -Wconversion -Wcast-qual -Wdeprecated -o CMakeFiles/pybind11_tests.dir/test_tagbased_polymorphic.cpp.o -c pybind11/tests/test_tagbased_polymorphic.cpp In file included from pybind11/include/pybind11/attr.h:13, from pybind11/include/pybind11/pybind11.h:44, from pybind11/tests/pybind11_tests.h:2, from pybind11/tests/test_tagbased_polymorphic.cpp:10: pybind11/include/pybind11/cast.h: In instantiation of ‘static std::pair<const void*, const pybind11::detail::type_info*> pybind11::detail::type_caster_base<type>::src_and_type(const itype*) [with type = Animal; pybind11::detail::type_caster_base<type>::itype = Animal]’: pybind11/include/pybind11/cast.h:906:31: required from ‘static pybind11::handle pybind11::detail::type_caster_base<type>::cast_holder(const itype*, const void*) [with type = Animal; pybind11::detail::type_caster_base<type>::itype = Animal]’ pybind11/include/pybind11/cast.h:1566:51: required from ‘static pybind11::handle pybind11::detail::move_only_holder_caster<type, holder_type>::cast(holder_type&&, pybind11::return_value_policy, pybind11::handle) [with type = Animal; holder_type = std::unique_ptr<Animal>]’ pybind11/include/pybind11/stl.h:175:69: required from ‘static pybind11::handle pybind11::detail::list_caster<Type, Value>::cast(T&&, pybind11::return_value_policy, pybind11::handle) [with T = std::vector<std::unique_ptr<Animal> >; Type = std::vector<std::unique_ptr<Animal> >; Value = std::unique_ptr<Animal>]’ pybind11/include/pybind11/pybind11.h:159:43: required from ‘void pybind11::cpp_function::initialize(Func&&, Return (*)(Args ...), const Extra& ...) [with Func = std::vector<std::unique_ptr<Animal> > (*&)(); Return = std::vector<std::unique_ptr<Animal> >; Args = {}; Extra = {pybind11::name, pybind11::scope, pybind11::sibling}]’ pybind11/include/pybind11/pybind11.h:64:9: required from ‘pybind11::cpp_function::cpp_function(Return (*)(Args ...), const Extra& ...) [with Return = std::vector<std::unique_ptr<Animal> >; Args = {}; Extra = {pybind11::name, pybind11::scope, pybind11::sibling}]’ pybind11/include/pybind11/pybind11.h:819:22: required from ‘pybind11::module& pybind11::module::def(const char*, Func&&, const Extra& ...) [with Func = std::vector<std::unique_ptr<Animal> > (*)(); Extra = {}]’ pybind11/tests/test_tagbased_polymorphic.cpp:141:36: required from here pybind11/include/pybind11/cast.h:880:61: error: ambiguous template instantiation for ‘struct pybind11::polymorphic_type_hook<Animal, void>’ const void *vsrc = polymorphic_type_hook<itype>::get(src, instance_type); ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~ pybind11/include/pybind11/cast.h:844:8: note: candidates are: ‘template<class itype> struct pybind11::polymorphic_type_hook<itype, typename std::enable_if<std::is_polymorphic<_Tp>::value, void>::type> [with itype = Animal]’ struct polymorphic_type_hook<itype, detail::enable_if_t<std::is_polymorphic<itype>::value>> ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ pybind11/tests/test_tagbased_polymorphic.cpp:115:12: note: ‘template<class itype> struct pybind11::polymorphic_type_hook<itype, typename std::enable_if<std::is_base_of<Animal, itype>::value, void>::type> [with itype = Animal]’ struct polymorphic_type_hook<itype, detail::enable_if_t<std::is_base_of<Animal, itype>::value>> ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ In file included from pybind11/include/pybind11/attr.h:13, from pybind11/include/pybind11/pybind11.h:44, from pybind11/tests/pybind11_tests.h:2, from pybind11/tests/test_tagbased_polymorphic.cpp:10: pybind11/include/pybind11/cast.h:880:61: error: incomplete type ‘pybind11::polymorphic_type_hook<Animal, void>’ used in nested name specifier const void *vsrc = polymorphic_type_hook<itype>::get(src, instance_type); ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~Ralf W. Grosse-Kunstleve committed -
Currently user specializations of the form template <typename itype> struct polymorphic_type_hook<itype, std::enable_if_t<...>> { ... }; will fail if itype is also polymorphic, because the existing specialization will also be enabled, which leads to 2 equally viable candidates. With this change, user provided specializations have higher priority than the built in specialization for polymorphic types.Ralf W. Grosse-Kunstleve committed
-
- 31 Mar, 2020 2 commits
-
-
Wenzel Jakob committed
-
Wenzel Jakob committed
-
- 04 Mar, 2020 1 commit
-
-
Wenzel Jakob committed
-
- 22 Jan, 2020 1 commit
-
-
Baljak committed
-
- 17 Jan, 2020 1 commit
-
-
fwjavox committed
-
- 05 Jan, 2020 2 commits
-
-
Baljak committed
-
Robert Haschke committed
-
- 02 Jan, 2020 2 commits
-
-
When binding code immediately throws an exception of type py::error_already_set (e.g. via py::module::import that fails), the catch block sets an import error as expected. Unfortunately, following this, the deconstructor of py::error_already_set decides to call py::detail::get_internals() and set up various internal data structures of pybind11, which fails given that the error flag is active. The call stack of this looks as follows: Py_init_mymodule() -> __cxa_decrement_exception_refcount -> error_already_set::~error_already_set() -> gil_scoped_acquire::gil_scoped_acquire() -> detail::get_internals() -> ... -> pybind11::detail::simple_collector() -> uh oh.. The solution is simple: we call detail::get_internals() once before running any binding code to make sure that the internal data structures are ready.
Wenzel Jakob committed -
Wenzel Jakob committed
-
- 31 Dec, 2019 1 commit
-
-
Wenzel Jakob committed
-
- 30 Dec, 2019 1 commit
-
-
This commit introduces the use of C++17-style fold expressions when casting tuples & the argument lists of functions. This change can improve performance of the resulting bindings: because fold expressions have short-circuiting semantics, pybind11 e.g. won't try to cast the second argument of a function if the first one failed. This is particularly effective when working with functions that have many overloads with long argument lists.
Wenzel Jakob committed
-
- 19 Dec, 2019 2 commits
-
-
* Fix test build in C++20 * Add C++20 char8_t/u8string support
Vemund Handeland committed -
If a debug interpreter is detected, we allow linking with pythonXX_d.lib under windows.
JGamache-autodesk committed
-
- 13 Dec, 2019 1 commit
-
-
Wenzel Jakob committed
-
- 12 Dec, 2019 1 commit
-
-
Boris Staletic committed
-
- 11 Dec, 2019 4 commits
-
-
This reverts commit 819802da.
Wenzel Jakob committed -
Nils Berg committed
-
Boris Staletic committed
-
Boris Staletic committed
-
- 28 Nov, 2019 3 commits
-
-
Isuru Fernando committed
-
This reverts commit 61e4f118.
Wenzel Jakob committed -
Wenzel Jakob committed
-
- 25 Nov, 2019 2 commits
-
-
Eric Cousineau committed
-
* Add FAQ entry, with code example, for dealing with long functions interruption
Charles Brossollet committed
-
- 24 Nov, 2019 1 commit
-
-
Sebastian Koslowski committed
-
- 16 Nov, 2019 1 commit
-
-
Francesco Biscani committed
-
- 14 Nov, 2019 4 commits
-
-
Francesco Biscani committed
-
Fixing SystemError when nb_bool/nb_nonzero sets a Python exception in type_caster<bool>::load (#1976)
Yannick Jadoul committed -
Erick Matsen committed
-
Matthew Dawkins committed
-
- 31 Oct, 2019 2 commits
-
-
Add Python 3.8 to considered versions in CMake for additional hints. https://cmake.org/cmake/help/v3.2/module/FindPythonLibs.html
Axel Huebl committed -
* test pair-copyability on C++17 upwards The stdlib falsely detects containers like M=std::map<T, U> as copyable, even when one of T and U is not copyable. Therefore we cannot rely on the stdlib dismissing std::pair<T, M> by itself, even on C++17. * fix is_copy_assignable bind_map used std::is_copy_assignable which suffers from the same problems as std::is_copy_constructible, therefore the same fix has been applied. * created tests for copyability
Sebastian Gsänger committed
-
- 23 Oct, 2019 1 commit
-
-
Hans Dembinski committed
-
- 22 Oct, 2019 2 commits
-
-
Hans Dembinski committed
-
Don't assume that just because the language version is C++17 that the standard library offers all C++17 features, too. When using clang-6.0 and --std=c++17 on Ubuntu 18.04 with libstdc++, __cpp_sized_deallocation is false.
Jeremy Nimmer committed
-
- 18 Oct, 2019 1 commit
-
-
Riccardo Bertossa committed
-