It seems that shared_ptr::use_count() does not include weak_ptr instances. Therefore shared_ptr::use_count()==1 (aka unique()) does *not* ensure exclusive ownership! This breaks the assumption used by shared_vector::make_unique() to avoid allocating a new array in some cases.
9.7 KiB
9.7 KiB