Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

git merge smart_holder #30151

Merged
merged 4 commits into from
Aug 25, 2024
Merged

git merge smart_holder #30151

merged 4 commits into from
Aug 25, 2024

Commits on Aug 25, 2024

  1. Split out non-functional changes from pybind/pybind11#5332 (google#5333)

    PREPARATION for:
    
    PR google#5332 — Fix handling of const unique_ptr<T, D> & (do not disown).
    
    Splitting out so that the functional changes under PR google#5332 will be more obvious.
    Ralf W. Grosse-Kunstleve authored Aug 25, 2024
    Configuration menu
    Copy the full SHA
    bf54ecd View commit details
    Browse the repository at this point in the history
  2. Split out (almost) pure refactoring from pybind/pybind11#5332 (google…

    …#5334)
    
    PREPARATION for:
    
    PR google#5332 — Fix handling of const unique_ptr<T, D> & (do not disown).
    
    Splitting out so that the functional changes under PR google#5332 will be more obvious.
    
    The only functional change under this PR is that
    
    ```
                assert(custom_deleter_ptr != nullptr);
    ```
    
    is replaced with:
    
    ```
                if (custom_deleter_ptr == nullptr) {
                    throw std::runtime_error(
                        std::string("smart_holder::extract_deleter() precondition failure (") + context
                        + ").");
                }
    ```
    Ralf W. Grosse-Kunstleve authored Aug 25, 2024
    Configuration menu
    Copy the full SHA
    0e49463 View commit details
    Browse the repository at this point in the history
  3. [smart_holder] Fix handling of const unique_ptr<T, D> & (do not dis…

    …own). (google#5332)
    
    * Replace `unique_ptr_cref_roundtrip()` with `pass_unique_ptr_cref()`, `rtrn_unique_ptr_cref()` to make the current behavior obvious.
    
    * add in unique_ptr_storage, unique_ptr_storage_deleter
    
    * Add shared_ptr_storage (with that disowning fails as expected).
    
    * Add load_as_const_unique_ptr()
    
    * Restore original struct_smart_holder.h
    
    * factor out `smart_holder::extract_deleter()`
    
    * Better error message.
    
    * Misc cleanup/tidying.
    
    * Use `re.match("ctor_arg(_MvCtor)*_MvCtor", ...)` for compatibility with MSVC, NVHPC, ICC
    
    * Add small comments.
    
    * Fix small, inconsequential oversight in test code.
    
    * Apply suggestion by @iwanders under PR google#5334
    
    * Remove `std::move()` in `smart_holder::extract_deleter()`
    
    * Add `static_assert()` following a suggestion by @iwanders under PR google#5334
    Ralf W. Grosse-Kunstleve authored Aug 25, 2024
    Configuration menu
    Copy the full SHA
    04d9f84 View commit details
    Browse the repository at this point in the history
  4. Merge branch 'smart_holder' into pybind11k_merge_sh

    Ralf W. Grosse-Kunstleve committed Aug 25, 2024
    Configuration menu
    Copy the full SHA
    43bdd56 View commit details
    Browse the repository at this point in the history