diff --git a/include/pybind11/detail/type_caster_base.h b/include/pybind11/detail/type_caster_base.h index 212a944afe..071de23b56 100644 --- a/include/pybind11/detail/type_caster_base.h +++ b/include/pybind11/detail/type_caster_base.h @@ -62,10 +62,7 @@ class loader_life_support { public: /// A new patient frame is created when a function is entered - loader_life_support() { - parent = get_stack_top(); - set_stack_top(this); - } + loader_life_support() : parent{get_stack_top()} { set_stack_top(this); } /// ... and destroyed after it returns ~loader_life_support() {