Performs instance initialization including constructing a holder and registering the known instance. Should be called as soon as the `type` value_ptr is set for an instance. Takes an optional pointer to an existing holder to use; if not specified and the instance is `.owned`, a new holder will be constructed to manage the value pointer.
| 1918 | /// an optional pointer to an existing holder to use; if not specified and the instance is |
| 1919 | /// `.owned`, a new holder will be constructed to manage the value pointer. |
| 1920 | static void init_instance(detail::instance *inst, const void *holder_ptr) { |
| 1921 | auto v_h = inst->get_value_and_holder(detail::get_type_info(typeid(type))); |
| 1922 | if (!v_h.instance_registered()) { |
| 1923 | register_instance(inst, v_h.value_ptr(), v_h.type); |
| 1924 | v_h.set_instance_registered(); |
| 1925 | } |
| 1926 | init_holder(inst, v_h, (const holder_type *) holder_ptr, v_h.value_ptr<type>()); |
| 1927 | } |
| 1928 | |
| 1929 | /// Deallocates an instance; via holder, if constructed; otherwise via operator delete. |
| 1930 | static void dealloc(detail::value_and_holder &v_h) { |
no test coverage detected