
I would add IncrementPolicy with following default.
struct trivial_increment_policy { void inc( long& c ) { ++c; } bool dec( long& c ) { return --c == 0; } }
Now you can add your own
I considered this, but for some reason there's no policies in shared_ptr, so
I decided not to add one too.
I think counter should belong to policy too (but no-copying is still up to
intrusive_pointee_base).
struct trivial_increment_policy {
void inc() { ++c; }
bool dec() { return --c == 0; }
int c;
}
template