For historical reasons, I use QSharedPointer<T>
in my software. At some points, we want to store boost::shared_ptr<T>
that point to the same data, and which should keep alive the instances of the QSharedPointer<T>
.
The common way to do this is to keep a copy of the other smart pointer within the deleter of boost::shared_ptr<T>
. But to prevent the deleter from having different types for different T
s, which would prevent easily getting a QSharedPointer
back with boost::get_deleter
, when the corrresponding boost::shared_ptr
has been upcast, I wanted to store the original QSharedPointer<T>
as a QSharedPointer<void>
within the deleter, as opposed to using the T
.
But I find that QSharedPointer
is not up to the task, as it throws errors like "reference to void can't be done", when compiling its header.
Does anyone have an idea on how to make this work without exposing T
into the deleter?