- 09 Feb, 2021 40 commits
-
-
Ralf W. Grosse-Kunstleve committed
-
Adding return_value_policy::move to permissible policies for unique_ptr returns. New stats for all tests combined: 3 failed, 467 passed.
Ralf W. Grosse-Kunstleve committed -
Changing std::shared_ptr pointer/reference to const pointer/reference. New stats for all tests combined: 4 failed, 466 passed.
Ralf W. Grosse-Kunstleve committed -
Adding "Lazy allocation for unallocated values" (for old-style __init__) into load_value_and_holder. Deferring destruction of disowned holder until clear_instance, to remain inspectable for "uninitialized" or "disowned" detection. New stats for all tests combined: 5 failed, 465 passed.
Ralf W. Grosse-Kunstleve committed -
Adding unowned_void_ptr_from_direct_conversion to modified_type_caster_generic_load_impl. This fixes the last remaining segfault (test_numpy_dtypes). New stats for all tests combined: 12 failed, 458 passed.
Ralf W. Grosse-Kunstleve committed -
Bug fix: Adding have_value() to smart_holder_type_caster_load. With this test_builtin_casters succeeds. (All 42 tests build, 36 tests succeed, 5 run but have some failures, 1 segfault.)
Ralf W. Grosse-Kunstleve committed -
Introducing check_is_smart_holder_type_caster() function for runtime check, and reinterpreting record.default_holder as "uses_unique_ptr_holder". With this test_smart_ptr succeeds. (All 42 tests build, 35 tests succeed, 5 run but have some failures, 2 segfault.)
Ralf W. Grosse-Kunstleve committed -
Adding remaining PYBIND11_SMART_POINTER_HOLDER_TYPE_CASTERS. static_assert for "necessary conditions" for both types of default holder, static_assert for "strict conditions" guarded by new PYBIND11_STRICT_ASSERTS_CLASS_HOLDER_VS_TYPE_CASTER_MIX. All tests build & run as before with unique_ptr as the default holder, all tests build for smart_holder as the default holder, even with the strict static_assert.
Ralf W. Grosse-Kunstleve committed -
Adding PYBIND11_SMART_POINTER_HOLDER_TYPE_CASTERS in test_class.cpp (with this all but one test succeed with PYBIND11_USE_SMART_HOLDER_AS_DEFAULT).
Ralf W. Grosse-Kunstleve committed -
Softening static_assert, to only check specifically that smart_holder is not mixed with type_caster_base, and unique_ptr/shared_ptr holders are not mixed with smart_holder_type_casters.
Ralf W. Grosse-Kunstleve committed -
Ralf W. Grosse-Kunstleve committed
-
Ralf W. Grosse-Kunstleve committed
-
Introducing 1. type_caster_for_class_, used in PYBIND11_MAKE_OPAQUE, and 2. default_holder_type, used in stl_bind.h.
Ralf W. Grosse-Kunstleve committed -
Introducing PYBIND11_SMART_POINTER_HOLDER_TYPE_CASTERS. Using it in test_smart_ptr.cpp. With this test_smart_ptr builds with PYBIND11_USE_SMART_HOLDER_AS_DEFAULT and all but one test run successfully.
Ralf W. Grosse-Kunstleve committed -
Simplifying from_unique_ptr(): typename D = std::default_delete<T> is not needed. Factoring out is_std_default_delete<T>() for consistentcy between ensure_compatible_rtti_uqp_del() and from_unique_ptr().
Ralf W. Grosse-Kunstleve committed -
Factoring out struct and class definitions into anonymous namespace. Preparation for building with PYBIND11_USE_SMART_HOLDER_AS_DEFAULT.
Ralf W. Grosse-Kunstleve committed -
Disabling shared_ptr&, shared_ptr* tests when building with PYBIND11_USE_SMART_HOLDER_AS_DEFAULT for now, pending work on smart_holder_type_caster<shared_ptr>.
Ralf W. Grosse-Kunstleve committed -
Adding enable_if !is_smart_holder_type_caster to existing initimpl::construct(). With this test_factory_constructors.cpp builds with PYBIND11_USE_SMART_HOLDER_AS_DEFAULT.
Ralf W. Grosse-Kunstleve committed -
Adding initimpl::construct() overloads, resulting in test_class_sh_factory_constructors feature parity for py::class_ and py::classh.
Ralf W. Grosse-Kunstleve committed -
Ralf W. Grosse-Kunstleve committed
-
Ralf W. Grosse-Kunstleve committed
-
Removing include/pybind11/detail/smart_holder_type_casters.h from CMakeLists.txt, test_files.py (since it does not exist in this branch).
Ralf W. Grosse-Kunstleve committed -
Adding test_class_sh_factory_constructors, reproducing test_factory_constructors failure. Using py::class_ in this commit, to be changed to py::classh for debugging.
Ralf W. Grosse-Kunstleve committed -
Commenting out const in def_buffer(... const). With this, test_buffers builds and runs with PYBIND11_USE_SMART_HOLDER_AS_DEFAULT. Explanation why the const needs to be removed, or fix elsewhere, is still needed, but left for later.
Ralf W. Grosse-Kunstleve committed -
Ralf W. Grosse-Kunstleve committed
-
Ralf W. Grosse-Kunstleve committed
-
With this test_class.cpp builds and even mostly runs, except `test_multiple_instances_with_same_pointer`, which segfaults because it is using a `unique_ptr` holder but `smart_holder` `type_caster`. Also adding `static_assert`s to generate build errors for such situations, but guarding with `#if 0` to first pivot to test_factory_constructors.cpp.
Ralf W. Grosse-Kunstleve committed -
Ralf W. Grosse-Kunstleve committed
-
Ralf W. Grosse-Kunstleve committed
-
Introducing PYBIND11_USE_SMART_HOLDER_AS_DEFAULT macro (tested only undefined; there are many errors with the macro defined).
Ralf W. Grosse-Kunstleve committed -
Ralf W. Grosse-Kunstleve committed
-
Ralf W. Grosse-Kunstleve committed
-
Unification of unique_ptr, unique_ptr_with_deleter code in smart_holder_poc.h. Leads to more fitting error messages. Enables use of unique_ptr<T, D> smart_holder_type_casters also for unique_ptr<T>.
Ralf W. Grosse-Kunstleve committed -
Adding smart_holder_type_casters for unique_ptr with custom deleter. SEVERE CODE DUPLICATION. This commit is to establish a baseline for consolidating the unique_ptr code.
Ralf W. Grosse-Kunstleve committed -
Ralf W. Grosse-Kunstleve committed
-
Ralf W. Grosse-Kunstleve committed
-
Giving up on idea to use legacy init_instance only if is_base_of<type_caster_generic, type_caster<T>. There are use cases in the wild that define both a custom type_caster and class_.
Ralf W. Grosse-Kunstleve committed -
Ralf W. Grosse-Kunstleve committed
-
Ralf W. Grosse-Kunstleve committed
-
Moving get_local_load_function_ptr, init_instance_for_type to smart_holder_type_caster_class_hooks. Expanding static_assert in py::type::handle_of<> to accommodate smart_holder_type_casters.
Ralf W. Grosse-Kunstleve committed
-