-
Notifications
You must be signed in to change notification settings - Fork 99
LLPointer cleanup and modernizations from archive #5204
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
Conversation
That is, both `LLPointer::operator==()` and `operator!=()` and the free function `operator==()` and `operator!=()` now accept pointer types other than the type of the subject `LLPointer`, letting the compiler apply implicit pointer conversions or diagnose an error.
Instead of restating the whole class, requiring changes to be made in parallel (which has already failed), just make a template alias.
This affords strong exception safety. Also, eliminating the conditional may improve speed.
Given templated constructors and assignment operators, it's tempting to remove specific constructors and assignment operators with the same LLPointer<Type> parameters. That turns out to be a mistake. Add comments to warn future maintainers.
This allows removing #include "llerror.h" from llpointer.h. Also remove #include "llmutex.h" as a heavy way to get <boost/functional/hash.hpp>. That requires adding #include "llmutex.h" to llimage.h, llnotifications.h, llwatchdog.cpp and llvolumemgr.cpp, which were inheriting it from llpointer.h.
indra/llcommon/llpointer.h
Outdated
|
|
||
| #include "llerror.h" // *TODO: consider eliminating this | ||
| #include "llmutex.h" | ||
| #include <boost/functional/hash.hpp> |
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.
Any idea why we aren't using std::hash here?
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.
There's a std::hash and a boost::hash specialization down at the bottom of the file so that we have compatibility with both.
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.
I saw the 'struct hash' thing, but why do we need the boost variant and are not just cutting that part of the lib out?.
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.
Seems safe to remove it as we don't appear to be using any boost hash containers with LLPointer.
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.
Thank you!
…d::hash specialization to use std::hash internally Signed-off-by: Rye <[email protected]>
Description
This extracts and rebases a series of changes from
archive/developthat provides some nice cleanup and modernizations to LLPointer.Related Issues
Issue Link: #5078
Checklist
Please ensure the following before requesting review:
Additional Notes