
6 Jul
2009
6 Jul
'09
4:55 a.m.
2009/7/5 Zachary Turner <divisortheory@gmail.com>:
I was wondering from a design perspective, why was it decided that intrusive_ptr should rely on user-defined free functions intrusive_ptr_add_ref and intrusive_ptr_release to handle the reference counting? This makes it somewhat inconvenient, for some constant type T, to support having two different instances of intrusive_ptr<T>, each of which use a different reference counting strategy.
I'm rather confused why you'd want to keep 2 different reference counts in an object. As a workaround though, why not just use struct T1 : T {}; and struct T2 : T {}; if you need 2 distinct kinds?