Add weak_ptr typedefs to MOVEIT_DECLARE_PTR#206
Add weak_ptr typedefs to MOVEIT_DECLARE_PTR#206de-vri-es wants to merge 2 commits intomoveit:kinetic-develfrom
Conversation
Is I don't think we should get too complex with these macros. Still, this PR seems ok to me. |
Yes. All other usage of We can't be sure that users don't need I think I'm also leaning towards not adding these typedefs. They don't really hurt, but they can't be removed later without breaking backwards compatibility either. |
|
Does #215 replace or require this PR? It seems to me we decided these extra macros in this PR are not needed? |
|
I think so. I just don't think there is enough justification to add these typedefs. And it looks like nobody else thinks they're needed either. I think this can be closed. |
|
If somebody is interested in this, feel free to comment here. Closed for now |
Note: I'm not really sure if this PR is a good solution as it is. Opinions welcome.
This PR adds typedefs for
weak_ptrtoMOVEIT_DELCARE_PTR. Also discussed in #48, we want to tell people to use theshared_ptrtypedefs, but that doesn't currently leave them a way to use the matchingweak_ptr. This PR would solve that.On the other hand, use of
weak_ptris much more rare. One use is to avoidshared_ptrcycles. Such cycles can only be made by embedding the pointers inside the pointed-to type(s), and users can't really do that. Of course, there are undoubtedly other uses forweak_ptrsthat I'm not thinking of right now.So, do we want to add a ton of exposed typedefs for probably a small if not zero number of niche use cases?
Slightly off-topic: All this macro hackery made me think a bit. A macro-free C++11 solution would be this in a public header somewhere:
Or much less nice pre C++11:
Or even:
Or some variation on this theme. We could even use the not-so-pretty option just for
weak_ptrsto avoid adding a ton of public typedefs.