-
Notifications
You must be signed in to change notification settings - Fork 371
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
Isolate solv::ObjQueue #2289
Isolate solv::ObjQueue #2289
Conversation
2278171
to
9857d33
Compare
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.
Nice!
A slight nitpicking, new files should have 2023 instead of 2019 or 2022 in the license section for history consistency.
Looks very good to me! I was wondering about the header location ( And the rest was just some tiny comments. |
@wolfv Yes these headers are private (hence the |
@@ -252,6 +253,10 @@ set(LIBMAMBA_HEADERS | |||
${LIBMAMBA_INCLUDE_DIR}/mamba/api/update.hpp | |||
) | |||
|
|||
set(LIBMAMBA_PRIVATE_HEADERS | |||
${LIBMAMBA_SOURCE_DIR}/solv-cpp/queue.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.
Note that technically libmamba have more private headers, notably the ones in src/core/
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.
They are not really private, they are installed, and needed by public headers.
private: | ||
friend void swap(ObjQueue& a, ObjQueue& b) noexcept; | ||
|
||
::Queue m_queue = {}; |
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.
Side note that stylistically I would prefer default initialization to not have an assignation. I understand that it's valid in C++17, but it looks redundant and noisy to me when reading the code.
Weak "meh" here, to be clear.
std::stringstream ss = {}; | ||
ss << "Index " << pos << " is greater that the number of elements (" << size << ')'; |
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.
Use fmt here (maybe with a comment to use std::format
once C++20 is available)
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.
The idea is to keep these wrappers dependency free so I think we should avoid using fmt
until there is some strong need for it.
Bad branch manipulation. |
Part of #2302.
Here the Queue is isolated in a safe RAII object.
It was made to use std conventions rather than libsolv ones.
This is private API so does not have any consequence.
On the immediate side, it caught some memory leaks in
MSolver
!