-
Notifications
You must be signed in to change notification settings - Fork 34
Reduce boost usage #16
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
Split GetAnnotation() to 3 functions that emit the result via an output parameter and return true/false to designate whether it was set or not.
The remaining boost usages would need bigger changes. Is fully removing boost to be attempted? The README contains "The boost dependency should be eliminated". |
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.
Thanks for the PR! I'd like to merge this if the m_task_set
double-destroy problem mentioned below is addressed.
The remaining boost usages would need bigger changes. Is fully removing boost to be attempted? The README contains "The boost dependency should be eliminated".
Yes, I'd like to remove the boost dependency, and I see after this PR the remaining boost::optional
usages are more complicated to get rid of. One way might be to implement a small custom Optional
template class that only supports needed emplace
, reset
, operator bool
, and operator*
methods. I don't think this would be too difficult to do. One way might be to start from another optional implementation like https://github.com/abseil/abseil-cpp/blob/master/absl/types/optional.h and just remove all the code there that isn't needed.
e791cc5
to
8349490
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.
Code review ACK 8349490. Thanks for the change and followup!
I'm seeing a compiler error due to a (pre-existing) missing include exposed by this change:
Adding |
Fall back to the KISS boolean flag denoting whether the variable is set or not.
EventLoop::m_task_set was unnecessary defined as boost::optional<kj::TaskSet> because it is always initialized. It can, however, possibly be destroyed twice: in the EventLoop::loop() method (conditional) and in the EventLoop destructor when it goes out of scope (unconditional). So, use std::unique_ptr to handle this.
8349490
to
fb73b81
Compare
fb73b81 Change EventLoop::m_task_set to not use boost (Vasil Dimov) 138ad67 Change Field::(param and result) to not use boost (Vasil Dimov) 5724a2c Remove boost usage from GetAnnotation() (Vasil Dimov) cab9c51 Remove unnecessary boost include (Vasil Dimov) Pull request description: A few changes that remove the usage of boost from some places in the code. Top commit has no ACKs. Tree-SHA512: 5dc9698affd5b226ed227fe8ca3ce69bb2d21b46df7e760cbd8f82d026cad51ebf9787c9a40ad61244995eff1e25c81d523a051b75c4bad057c192736c449a9a
I was able to add the |
Thanks! I was just about to fix it, but you were quicker :) I did not get that compilation error (clang 8.0.1), but I guess that is not so interesting now. Next thing, time permitting, I will look to nuke the other boost usages. |
A few changes that remove the usage of boost from some places in the code.