The basic Idea is that there should be a policy for ref
counted pointers that looks to see if the pointer to
type inherits an embedded counter, if it does then the
policy automatically switches to the embedded ref
counter type, otherwise it uses an external count by
default. I have already implemented this myself and it
is typesafe and works well. The attached code is the
basic implementation. It should compile and work as is
but I haven't tested it (my source has a little bit
more that Loki doesn't need).
Log in to post a comment.