-
Notifications
You must be signed in to change notification settings - Fork 444
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
Replace boost string algorithms with their abseil counterparts #4482
Conversation
4e379ee
to
072b827
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.
Thank you for cleaning away the StringRef
. Could you also put [[deprecated(...)]]
on the StringRef
struct so the downstream tools are kind reminded to upgrade and we have a path to drop it completely some time in future? I think that would make sense :-).
On a more general note: is there a strong reason to replace boost algos with their abseil counterparts? It abseil significantly better? Is it easier to use? Do we strive to get rid of boost altogether? Since we have abseil for other reasons, I am not against this, but for example in case of the substitutions the boost syntax had some advantages (named paceholders).
lib/source_file.h
Outdated
@@ -319,6 +319,7 @@ class InputSources final { | |||
|
|||
} // namespace Util | |||
|
|||
// FIXME: Do we really need to have this in header? This pulls the whole iostream header | |||
inline void dbprint(const IHasDbPrint *o) { o->dbprint(std::cout); } |
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.
At the very least, we can probably put the implementation in .cpp
. But this seems like maybe it is there only to simplify debugging with gdb.
I like abseil string algorithms more. For example |
My personal opinion is that it is nice to keep our dependencies simple. Since we are basically forced to use Abseil with Protobuf we might as well make use of it. Since we do not want to keep two utility frameworks around we should slowly deprecated widespread usage of boost. Another reason I am in favor of slowly phasing out boost is that is generally a huge framework and unlike Abseil including one boost header can pull in many others. We do not need to get rid of it entirely but should be judicious of what we include. #3898 is an attempt to simplify things a little. |
I think after this PR we'll end with:
The latter could be replaced by boost::random is used for Mersenne-Twister – need to double check if these days normal standard library is mature enough to instantiate rng with bigint type. |
It seems it is not :-/
|
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.
This looks good to me.
@fruffy Will you please take a look when you have a chance? Thanks! |
Some refactoring and code movement while there
Will try to give a look tomorrow, things have been a bit busy lately.. |
Sure, no worries! Just wanted to clear my patch queue a bit :) |
Some refactoring and cleanup while there:
StringRef
replaced withstd::string_view
(header is not removed as I do not know how this might affect downstream)