You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I thought about this when I was writing it, but decided that namespaces gave it enough disambiguation. I deliberately always use the fully qualified name when using std::vectors in the internal code for this reason.
We could probably also always use the fully qualified name internally when dealing with cpp11::vectors, just to make it completely clear which vector we are talking about at all times.
Also I feel like the fact that the class template is really only internal makes this less severe, users will only see the non templated typedefs in their code and error messages.
If it's only internal it's not that big a deal I guess. But I still think important class names should be unique even with the namespaces, otherwise reading code requires context switching.
Activity
jimhester commentedon Jun 17, 2020
Sorry, my first reply was too harsh.
I thought about this when I was writing it, but decided that namespaces gave it enough disambiguation. I deliberately always use the fully qualified name when using
std::vectorsin the internal code for this reason.We could probably also always use the fully qualified name internally when dealing with
cpp11::vectors, just to make it completely clear which vector we are talking about at all times.Also I feel like the fact that the class template is really only internal makes this less severe, users will only see the non templated typedefs in their code and error messages.
lionel- commentedon Jun 18, 2020
If it's only internal it's not that big a deal I guess. But I still think important class names should be unique even with the namespaces, otherwise reading code requires context switching.
jimhester commentedon Jun 29, 2020
The internal name does come up in error messages, even though the typedef is also shown e.g.
So I think it might be worth renaming to
r_vectorto make that case more clear.Rename cpp11::string to cpp11::r_string