mirror of
https://github.com/pybind/pybind11.git
synced 2024-11-25 14:45:12 +00:00
Resolve clang-tidy errors and warnings.
This commit is contained in:
parent
56019a2d68
commit
b82892ae6f
@ -903,9 +903,10 @@ protected:
|
||||
void load_value(value_and_holder &&v_h) {
|
||||
if (typeinfo->default_holder) {
|
||||
sh_load_helper.loaded_v_h = v_h;
|
||||
type_caster_generic::load_value(std::move(v_h));
|
||||
type_caster_generic::load_value(std::move(v_h)); // NOLINT(performance-move-const-arg)
|
||||
return;
|
||||
} else if (v_h.holder_constructed()) {
|
||||
}
|
||||
if (v_h.holder_constructed()) {
|
||||
value = v_h.value_ptr();
|
||||
shared_ptr_holder = v_h.template holder<std::shared_ptr<type>>();
|
||||
return;
|
||||
@ -1027,7 +1028,7 @@ public:
|
||||
if (typeinfo->default_holder) {
|
||||
sh_load_helper.loaded_v_h = v_h;
|
||||
sh_load_helper.loaded_v_h.type = get_type_info(typeid(type));
|
||||
type_caster_generic::load_value(std::move(v_h));
|
||||
type_caster_generic::load_value(std::move(v_h)); // NOLINT(performance-move-const-arg)
|
||||
return;
|
||||
}
|
||||
throw std::runtime_error("BAKEIN_WIP: What is the best behavior here (load_value)?");
|
||||
|
@ -611,7 +611,7 @@ struct value_and_holder_helper {
|
||||
|
||||
// have_holder() must be true or this function will fail.
|
||||
void throw_if_instance_is_currently_owned_by_shared_ptr() const {
|
||||
auto vptr_gd_ptr = std::get_deleter<pybindit::memory::guarded_delete>(holder().vptr);
|
||||
auto *vptr_gd_ptr = std::get_deleter<pybindit::memory::guarded_delete>(holder().vptr);
|
||||
if (vptr_gd_ptr != nullptr && !vptr_gd_ptr->released_ptr.expired()) {
|
||||
throw value_error("Python instance is currently owned by a std::shared_ptr.");
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user