-
-
Notifications
You must be signed in to change notification settings - Fork 4.6k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Provide dynamic and static pointer casts in pcl
namespace to allow easy migration from boost
to std
smart pointers
#3770
Provide dynamic and static pointer casts in pcl
namespace to allow easy migration from boost
to std
smart pointers
#3770
Conversation
Based on the CI, I'd say that we need
|
If I'm not mistaken ADL does not work here because smart pointer casts are function templates taking an explicit template parameter - this was fixed in C++20 but you have to workaround it in earlier standard versions. You can work around it by first making one of the names visible to the compiler in scope, then ADL should work properly: boost::shared<U> ptr;
using std::dynamic_pointer_cast; // The compiler sees a function template and considers that unqualified `dynamic_pointer_cast` has to be resolved as a function name/overload set
auto ptr2 = dynamic_pointer_cast<T>(ptr); // ADL is performed, boost::dynamic_pointer_cast is found despite std:: being used to make the name visible Sprinkling |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
Just waiting for another set of eyes before merge. |
pcl
namespace to allow easy migration
pcl
namespace to allow easy migrationpcl
namespace to allow easy migration from boost
to std
smart pointers
…sy migration in future (PointCloudLibrary#3770) * unqualify boost::dynamic_pointer_cast for switch to std:: * unqualify boost::static_pointer_cast for switch to std:: * have consistent using declarations
Stems from #3750.