Boost logo

Boost :

Subject: Re: [boost] intrusive_ptr design question
From: Scott McMurray ([hidden])
Date: 2009-07-06 00:55:18

2009/7/5 Zachary Turner <divisortheory_at_[hidden]>:
> 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?

Boost list run by bdawes at, gregod at, cpdaniel at, john at