>>>>> "Hyrum K. Wright" <hyrum_wri...@mail.utexas.edu>:
> Refcounting smartpointers are used to avoid duplication of the > underlying C structures, but they are completely private. I've got > serious reservations about exposing that complexity in the external > object interfaces. Given those reservations, the API would just > return a vanilla pointer, which leaves the caller the responsibility > of freeing it. Here I'm not following you. You would hide the complexity of smart pointers, and would return plain pointers? Hm... the first I wouldn't worry about, and on the second I would go to great lenghts to make it hard to get at the plain pointers. At least if we're talking about a variant of your alternative 2. >> Generally 1 gives a nicer API. But if you have any inheritance and >> virtual methods going, then 2 is simplest. > No inheritance or virtual stuff, as of yet, so not a concern. Ok, that makes it simpler. Then go for 1. I would have inheritance here to make a SPOC for the refcounting, but it could be done without virtual methods.